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 scoder
Recipients scoder, serhiy.storchaka
Date 2017-09-04.12:09:50
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1504526991.38.0.871992270339.issue31336@psf.upfronthosting.co.za>
In-reply-to
Content
Comparing against CPython master as of 122e88a8354e3f75aeaf6211232dac88ac296d54

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

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

Patched:
$ ./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.
History
Date User Action Args
2017-09-04 12:09:51scodersetrecipients: + scoder, serhiy.storchaka
2017-09-04 12:09:51scodersetmessageid: <1504526991.38.0.871992270339.issue31336@psf.upfronthosting.co.za>
2017-09-04 12:09:51scoderlinkissue31336 messages
2017-09-04 12:09:50scodercreate