Author scoder
Recipients scoder, serhiy.storchaka
Date 2017-09-04.12:09:50
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Comparing against CPython master as of 122e88a8354e3f75aeaf6211232dac88ac296d54

I rebuilt my CPython to get clean results, and that still gave me almost 15% overall speedup.

$ ./python -m timeit 'class Test: pass'
20000 loops, best of 5: 9.55 usec per loop

$ ./python -m timeit 'class Test: pass'
50000 loops, best of 5: 8.27 usec per loop

I came across this when benchmarking the class creation in Cython, which seemed slow, and after a couple of tweaks, I ended up with 97% of the runtime inside of CPython, so I took a look over the fence.

According to callgrind, the original version spent over 125M instructions inside of _PyType_Lookup() for the timeit run, whereas the patched version only counts about 92M, that's about 25% less.
Date User Action Args
2017-09-04 12:09:51scodersetrecipients: + scoder, serhiy.storchaka
2017-09-04 12:09:51scodersetmessageid: <>
2017-09-04 12:09:51scoderlinkissue31336 messages
2017-09-04 12:09:50scodercreate