[Twisted-Python] Performance issue in reactor.callLater

Jp Calderone exarkun at divmod.com
Tue Sep 7 13:07:46 EDT 2004

Stefan Behnel wrote:
> Stefan Behnel schrieb:
>> I guess I do see a problem if the value of a call somewhere in the 
>> heap is changed. That brakes the heap invariant and may conflict with 
>> further changes to the heap. Let me think about it.
> Ok, I thought about it. And I believe the best way to do this is to 
> write a specialized heap version. I copied the heapq implementation and 
> adapted it so that it keeps track of the position in the heap for each 
> DelayedCall. That makes it possible to remove a call without linear 
> overhead and in log(N) time.
 > [snip]

   heapq.py is under the PSF license.  PSF is roughly similar to MIT. 
Is this going to be okay for inclusion in Twisted?


More information about the Twisted-Python mailing list