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 gvanrossum, vstinner, yselivanov
Date 2014-01-16.09:21:41
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1389864101.93.0.127805548268.issue20275@psf.upfronthosting.co.za>
In-reply-to
Content
> 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.
History
Date User Action Args
2014-01-16 09:21:41vstinnersetrecipients: + vstinner, gvanrossum, yselivanov
2014-01-16 09:21:41vstinnersetmessageid: <1389864101.93.0.127805548268.issue20275@psf.upfronthosting.co.za>
2014-01-16 09:21:41vstinnerlinkissue20275 messages
2014-01-16 09:21:41vstinnercreate