STINNER Victor added the comment:

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

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue29358>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to