[Twisted-Python] Two main loops
Drew Smathers
drew.smathers at gmail.com
Wed Nov 14 14:08:22 EST 2007
> Actually, punting to another thread or process is still going to slow
> down your rendering, but in a much less deterministic way. The OS
> scheduler is going to be interrupting the rendering rather than the
> long-running serialization function. Breaking down the serialization
> work into smaller chunks will allow you to better control what's going
> on.
>
Holy crap! I just grew an extra brain cell! It has tingly sensation like
selson blue.
So let me offer some empirical evidence of this phenomenon which I was not
quite understanding until reading your comment - of course, it makes
complete sense now. I've been working on a cheesey game in my spare time
called Twisted Wars (yes, the Twisted), and just to amuse myself I decided
to run the reactor normally rather than threaded select and model the
runtime loop as a cooperative iterator - the idea being that eventually the
runtime loop could be many cooiterators, to allow for an actor-based system.
To my surprise, after changing the core runtime to a cooiterator, my frame
rate improved (albeit only about +5 - but this might be more noticeable if I
had a decent frame rate to start with). I explained to a friend who's also
working on the game and they refused to believe me! Ha!
-Drew
--
\\\\\/\"/\\\\\\\\\\\
\\\\/ // //\/\\\\\\\
\\\/ \\// /\ \/\\\\
\\/ /\/ / /\/ /\ \\\
\/ / /\/ /\ /\\\ \\
/ /\\\ /\\\ \\\\\/\
\/\\\\\/\\\\\/\\\\\\
d.p.s
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://twistedmatrix.com/pipermail/twisted-python/attachments/20071114/b0a7cc7c/attachment.htm
More information about the Twisted-Python
mailing list