Message257171
Interning the __module__ string causes small performance hit:
$ ./python -m timeit -s "from itertools import chain" -- "chain.__module__; chain.__module__; chain.__module__; chain.__module__; chain.__module__; chain.__module__; chain.__module__; chain.__module__; chain.__module__; chain.__module__"
Unpatched: 1.93 usec per loop
Patched: 4.09 usec per loop
This can be avoided if cache created string in type's __dict__. Following patch makes __module__ retrieving for non-heap types as fast as for heap types:
Patched2: 0.871 usec per loop |
|
Date |
User |
Action |
Args |
2015-12-29 07:43:41 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, rhettinger, pitrou, alexandre.vassalotti |
2015-12-29 07:43:41 | serhiy.storchaka | set | messageid: <1451375021.62.0.919417769912.issue25856@psf.upfronthosting.co.za> |
2015-12-29 07:43:41 | serhiy.storchaka | link | issue25856 messages |
2015-12-29 07:43:41 | serhiy.storchaka | create | |
|