[Twisted-Python] integrating CompStrm//adding background processing

Bill la Forge laforge49 at yahoo.co.in
Sun May 16 22:43:39 EDT 2004

Sorry for the confusion.
In the CompStrm project, I'm developing an alternative asyn programming 
style, in an attempt to make such code easier to read/maintain. Like 
flow, it is based on the yield statement. Unlike flow, it requires a 
mechanism for executing code in the background of the main thread.
So I'm not speeding up Twisted in any way. Rather, I'm adding a feature, 
all be it one that could be easily abused, by allowing for the inclusion of
an additional function call in the reactor main loop.
My initial approach, of using callLater for successive invocations, was 
flawed because of the limited granularity of time available on a PC. This 
means that I was only able to capture control for a very small number of
main loop cycles. But by inserting an additional method call, I am now 
able to perform a little background processing with every cycle.
As for the timing, I'm counting the number of items I can pass on an
async pipe between two virtual processes running in the background of
the main thread. Details for running over asyncore are available here:

Glyph Lefkowitz <glyph at divmod.com> wrote:
Hi Bill,

I appreciate reports of performance issues, and I'm sure the reactor 
could be sped up a bit - but this report seemed a bit vague, and as far 
as a few helpful folks on #twisted could tell, wrong.

> Just using reactor.callLater, I could only get a speed of 90, in 
> contrast to
> the asyncore integration which was doing better than 12,000.

90 whats per what on what? How exactly did you measure this?

We assumed you meant "90 trivial calls per second" and "on relatively 
recent hardware". The only test we did that made this radical kind of 
difference was inserting a 'print' statement into the "trivial" 
callback. The numbers for callLaters-per-second on various hardware we 
had lying around, mostly around ~2GhZ athlons, were in the 15000-25000 

Yahoo! India Matrimony: Find your partner online.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://twistedmatrix.com/pipermail/twisted-python/attachments/20040517/35c64529/attachment.htm 

More information about the Twisted-Python mailing list