[Python-Dev] tiny optimization in ceval mainloop

Guido van Rossum guido@python.org
Thu, 29 Aug 2002 20:06:09 -0400


> I noticed that one frequently executed line in the mainloop is testing
> whether either the ticker has dropped to 0 or if there are
> things_to_do.  Would it be kosher to just drop the ticker to 0 whenever
> things_to_do is set to true?  Then you'd only need to check the ticker
> each time through.

I think not -- Py_AddPendingCall() is supposed to be called from
interrupts and other low-level stuff, where you don't know whose
thread state you would get.  Too bad, it was a nice idea.

--Guido van Rossum (home page: http://www.python.org/~guido/)