This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Michael.Felt
Recipients David.Edelsohn, Michael.Felt, serhiy.storchaka, vstinner
Date 2018-01-08.17:13:59
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <54818ed4-ec41-22bc-7f0c-1d71fb79bbff@felt.demon.nl>
In-reply-to <03a937d6-59a5-4516-89fc-9520d8543a5f@felt.demon.nl>
Content
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 issue32399 -

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?
History
Date User Action Args
2018-01-08 17:13:59Michael.Feltsetrecipients: + vstinner, serhiy.storchaka, David.Edelsohn
2018-01-08 17:13:59Michael.Feltlinkissue28009 messages
2018-01-08 17:13:59Michael.Feltcreate