Neutron shared routines and utilities.
Go to file
Antoni Segura Puimedon b5b7131f4e
net_utils: Speed up mac address generation
Using getrandbits supposes a huge speedup:

Py2
In [2]: %timeit random.randint(0, 0xff)
The slowest run took 28.53 times longer than the fastest.
This could mean that an intermediate result is being cached.
1000000 loops, best of 3: 769 ns per loop

In [3]: %timeit random.getrandbits(8)
The slowest run took 54.81 times longer than the fastest.
This could mean that an intermediate result is being cached.
1000000 loops, best of 3: 126 ns per loop

Py3

In [3]: %timeit random.randint(0, 0xff)
The slowest run took 288.80 times longer than the fastest.
This could mean that an intermediate result is being cached.
1000000 loops, best of 3: 1.15 µs per loop

In [4]: %timeit random.getrandbits(8)
The slowest run took 29.15 times longer than the fastest.
This could mean that an intermediate result is being cached.
10000000 loops, best of 3: 109 ns per loop

Change-Id: Id6b86c7d2cf88feb81b79862d93f8d06aeb8fa63
Signed-off-by: Antoni Segura Puimedon <antonisp@celebdor.com>
2017-10-13 13:32:42 +02:00
api-ref/source Merge "bgpvpn-vni api extension" 2017-10-05 09:49:58 +00:00
doc/source Merge "add api ref and doc link validation to release" 2017-10-05 02:12:11 +00:00
neutron_lib net_utils: Speed up mac address generation 2017-10-13 13:32:42 +02:00
releasenotes revert get_random_mac behavior from review 400408 2017-10-05 11:00:14 -06:00
tools Parameter modifications of edit-constraints 2017-08-22 10:03:51 +02:00
.coveragerc Improvements to tox envs 2015-12-19 01:00:22 -05:00
.gitignore Fix unit test failures due to switch to testr changes 2017-09-14 08:17:35 -07:00
.gitreview Added .gitreview 2015-11-19 19:54:39 +00:00
.mailmap Initial cookiecutter commit 2015-11-20 17:24:43 -07:00
.stestr.conf Fix unit test failures due to switch to testr changes 2017-09-14 08:17:35 -07:00
.testr.conf Improvements to tox envs 2015-12-19 01:00:22 -05:00
babel.cfg Initial cookiecutter commit 2015-11-20 17:24:43 -07:00
CONTRIBUTING.rst Merge "Update links in CONTRIBUTING.rst" 2017-10-05 20:47:37 +00:00
HACKING.rst Update the documentation link for doc migration 2017-07-20 15:46:41 +00:00
LICENSE Initial cookiecutter commit 2015-11-20 17:24:43 -07:00
README.rst Update links in README 2017-09-06 14:25:53 +08:00
requirements.txt Updated from global requirements 2017-10-05 18:54:58 +00:00
setup.cfg Update the documentation link for doc migration 2017-07-20 15:46:41 +00:00
setup.py Updated from global requirements 2017-03-02 11:49:11 +00:00
test-requirements.txt Updated from global requirements 2017-10-05 18:54:58 +00:00
tox.ini add api ref and doc link validation to release 2017-09-21 15:20:10 -06:00

Team and repository tags

image

neutron-lib

Neutron shared routines and utilities

Features

  • TODO