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 vstinner
Recipients josh.r, methane, rhettinger, serhiy.storchaka, vstinner, yselivanov
Date 2017-01-25.17:42:16
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
I implemented more optimizations:

* type_call() uses FASTCALL
* object_new() and object_init() use FASTCALL
* _asyncio.Future new & init use FASTCALL

As a result, create an _asyncio.Future is now 1.45x faster:

haypo@smithers$ ./python -m perf timeit -s 'import _asyncio, asyncio; Future=_asyncio.Future; loop=asyncio.get_event_loop()' 'Future(loop=loop)' --compare-to=../default-ref/python 
Median +- std dev: [ref] 411 ns +- 8 ns -> [fast_init] 283 ns +- 10 ns: 1.45x faster (-31%)

Yury> Great. Can you share the Richards benchmark results?  It specifically stresses class instantiation, so we should be able to see the improvement.

While doesn't call _PyStack_AsTuple() anyone in the benchmark (it seems like it full uses FASTCALL), it seems like there is simply zero impact on performance :-(

$ ./python -m perf compare_to richards_ref.json richards_fastinit.json 
Benchmark hidden because not significant (1): richards
Date User Action Args
2017-01-25 17:42:16vstinnersetrecipients: + vstinner, rhettinger, methane, serhiy.storchaka, yselivanov, josh.r
2017-01-25 17:42:16vstinnersetmessageid: <>
2017-01-25 17:42:16vstinnerlinkissue29358 messages
2017-01-25 17:42:16vstinnercreate