[Twisted-Python] Why is Int23StringReceiver so slow?

Brian Granger bgranger at scu.edu
Wed Aug 24 14:58:46 EDT 2005


I am designing and implementing a custom protocol using Twisted.  I  
have wanted to design the protocol to use int 32 prefixed strings.  I  
wrote a test version of my server using Twisted's Int32StringReceiver  
protocol class but it seemed really slow.  To test this out I have  
written and tested two echo servers: one that uses LineReceiver and  
one that uses Int32StringReceiver.  I have benchmarked both of these  
echo servers by making multiple connections to each.  I find that the  
LineReceiver based echo server is about 200 times as fast as the  

Is the Int32StringReceiver really that slow?  Why?  What am I  
missing?  Are there hidden assumptions that I am missing?  Can it be  
made faster?

Thanks in advance!


More information about the Twisted-Python mailing list