Message286271
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 bm_richards.py 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:16 | vstinner | set | recipients:
+ vstinner, rhettinger, methane, serhiy.storchaka, yselivanov, josh.r |
2017-01-25 17:42:16 | vstinner | set | messageid: <1485366136.93.0.356107766724.issue29358@psf.upfronthosting.co.za> |
2017-01-25 17:42:16 | vstinner | link | issue29358 messages |
2017-01-25 17:42:16 | vstinner | create | |
|