[Twisted-Python] twisted.web and MySQLdb

Bob Ippolito bob at redivi.com
Wed Oct 29 13:13:44 EST 2003

On Oct 29, 2003, at 12:33 PM, Rene Dudfield wrote:

> ecn at metaslash.com wrote:
>> > Can you qualify "long time"?  And what's the bottleneck?  At the 
>> scale > of 100K or so function calls, Python isn't egregiously slow, 
>> certainly > not slow enough to not be able to outrun TCP connection 
>> setup...?
>> Hmm, maybe a minute?  I forget exactly.  It was like 4x slower than 
>> C++.
>> (I'm running Linux 2.6test1 with dual AMD Athlon MP/2000's).
> Probably be quite a bit quicker with psyco.  Psyco is generally quite 
> a bit quicker for looping things like this.
> Is there no batch interface for creating connections?  Something where 
> you pass it an array of your required connections, then let it fly.  
> Batching apis are good for things like this where function call, and 
> function setup are so large.

In any case, a benchmark that opens a whole bunch of sockets and does 
nothing with them is pretty retarded.  I'm actually pretty impressed 
that Python was only 4x slower at this kind of task, it has a whole lot 
of overhead (without psyco) for tight loops like that.


More information about the Twisted-Python mailing list