Serhiy Storchaka added the comment:

If such changes are acceptable, here is a part of my large patch fo modernizing 
stdlib sources.

Some microbenchmarks:

$ ./python -m timeit -s "from uuid import NAMESPACE_DNS as u" -- "u.bytes"
$ ./python -m timeit -s "from uuid import NAMESPACE_DNS as u" -- "u.bytes_le"
$ ./python -m timeit -s "from uuid import UUID" -- 
"UUID(bytes_le=b'abcdefghijklmnop')"

Before patch:
10000 loops, best of 3: 66.9 usec per loop
10000 loops, best of 3: 102 usec per loop
10000 loops, best of 3: 65.2 usec per loop

After patch:
100000 loops, best of 3: 3.98 usec per loop
100000 loops, best of 3: 10.8 usec per loop
10000 loops, best of 3: 32.1 usec per loop

----------
nosy: +serhiy.storchaka
Added file: http://bugs.python.org/file36245/modernize_uuid.patch

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue22131>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to