Message 309679 - Python tracker (original) (raw)
On 08/01/2018 17:22, Michael wrote:
On 08/01/2018 16:07, Michael Felt wrote:
Michael Felt <michael@felt.demon.nl> added the comment:
Considering that _uuid is now working for AIX -
some time differences - this is on POWER6 (10 years old system) - I expect POWER8 and POWER9 to be much quicker in exact times.
michael@x071:[/data/prj/python/git/xlc-python3-3.7]./python Python 3.7.0a3+ (heads/master:9b99747, JanĀ 8 2018, 15:50:03) [C] on aix6 Type "help", "copyright", "credits" or "license" for more information.
michael@x071:[/data/prj/python/git/xlc-python3-3.7]./python -m timeit -n 1000000 -r 5 'import uuid; getnode = uuid.getnode()' 1000000 loops, best of 5: 911 nsec per loop
michael@x071:[/data/prj/python/git/xlc-python3-3.7]python Python 2.7.12 (default, Sep 29 2016, 12:02:17) [C] on aix5 Type "help", "copyright", "credits" or "license" for more information.
michael@x071:[/data/prj/python/git/xlc-python3-3.7]python -m timeit -n 1000000 -r 5 'import uuid; getnode = uuid.getnode()' 1000000 loops, best of 5: 2.86 usec per loop michael@x071:[/data/prj/python/git/xlc-python3-3.7]
The second example is a) before the _uuid support was in the code, and b) even if in the code would not have been built on AIX5.
The relative difference is: 911/2860 :: 31.85/100 - or roughly 3x faster with _uuid.
As far as this issue is concerned - with _uuid active the buggy code I mentioned for getnode() is defunct as it does not get called/parsed. However, I shall continue with it.
Question: (must have questions!) - the behavior of getnode() without _uuid is a 'random' value for getnode() with my current setup BUT using the _uuid module it is a 'constant' that is related to (one of) the network interface(s). What is the desired behavior, specifically, of uuid.getnode() - constant, or 'random'?
Does uuid.py (./Lib/uuid.py) call _uuid.py?