The event loop(s) in app/base.py does method-lookup for every loop iteration,
something which is a known Python time sink for often-called methods. The
attached patch assigns idle(), step() and send() to local variables before
entering the loop.
Using local variables rather than method lookup leads to about 30% speedup per
loop iteration. Of course, the total effect on a real program is miniscule (by
far the most time is spend in code called by the loop after all). But it's a
simple "optimization" that don't really affect the readability of the code and
has no other negative downsides, so ...
Original issue reported on code.google.com by griatch on 13 Jun 2014 at 12:36
Original issue reported on code.google.com by
griatch
on 13 Jun 2014 at 12:36Attachments: