[Twisted-Python] Twisted and python-ogre
Bernie Roehl
broehl at gmail.com
Fri Feb 15 10:31:14 EST 2008
On Thu, Feb 14, 2008 at 1:30 PM, Bernie Roehl <broehl at gmail.com> wrote:
> I'm also wondering what would be the advantages of using a coiterator...?
As an experiment, I tried switching to using a coiterator. I got a 30%
increase in framerate!
My code now looks like this:
class RendererIterator: # used if usingCoiterator is True
def __iter__(self):
return self
def next(self):
ogre.WindowEventUtilities.messagePump()
root.renderOneFrame()
from twisted.internet.task import coiterate
renderSystem._initRenderTargets()
root.clearEventTimes()
coiterate(RendererIterator())
reactor.run()
Seems to work okay, but haven't tested it extensively.
Any Twisted-gurus have any comments/suggestions/cautions?
--
Bernie Roehl
Mail: broehl at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://twistedmatrix.com/pipermail/twisted-python/attachments/20080215/8ada9d37/attachment.htm
More information about the Twisted-Python
mailing list