Message286271
| 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 |
<1485366136.93.0.356107766724.issue29358@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
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 |
|