Message208263
> I like logger_is_enabled_for.patch.
I prefer debug_flag.patch because it is faster than logger_is_enabled_for.patch (see msg208214). I would like to write the most efficient code for BaseEventLoop._run_once() because this function is the real core of asyncio and it is called very frequently.
Test attached event_loop_run_once.py script. On such dummy example, _run_once() is called 4 times.
Note: Thanks to the nice design of yield from, wrapper() doesn't add an extra call to _run_once()!
Please think also to Trollius (port of asyncio on Python 2) which uses yield instead of yield-from. The same example calls _run_once() 10 times! The wrapper itself uses 2 calls. I don't know yet if Trollius can be modified to call _run_once() less frequently. It may be hard to keep the scheduling fair between concurrent running tasks. |
|
Date |
User |
Action |
Args |
2014-01-16 09:21:41 | vstinner | set | recipients:
+ vstinner, gvanrossum, yselivanov |
2014-01-16 09:21:41 | vstinner | set | messageid: <1389864101.93.0.127805548268.issue20275@psf.upfronthosting.co.za> |
2014-01-16 09:21:41 | vstinner | link | issue20275 messages |
2014-01-16 09:21:41 | vstinner | create | |
|