On Thu, Feb 14, 2008 at 1:30 PM, Bernie Roehl &lt;<a href="mailto:broehl@gmail.com">broehl@gmail.com</a>&gt; wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I&#39;m also wondering what would be the advantages of using a coiterator...?</blockquote><div><br>As an experiment, I tried switching to using a coiterator.&nbsp; I got a 30% increase in framerate!<br><br>My code now looks like this:<br>
<br>class RendererIterator:&nbsp; # used if usingCoiterator is True<br>&nbsp; &nbsp; def __iter__(self):<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return self<br>&nbsp;&nbsp;&nbsp; def next(self):<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ogre.WindowEventUtilities.messagePump()<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; root.renderOneFrame()<br>
<br>from twisted.internet.task import coiterate<br><br>renderSystem._initRenderTargets()<br>root.clearEventTimes()<br>coiterate(RendererIterator())<br>reactor.run()<br></div><br></div>Seems to work okay, but haven&#39;t tested it extensively.<br>
<br>Any Twisted-gurus have any comments/suggestions/cautions?<br><br>-- <br> Bernie Roehl<br> Mail: <a href="mailto:broehl@gmail.com">broehl@gmail.com</a>