[Twisted-Python] cBanana diffs

Bruce Mitchener bruce at cubik.org
Tue Jul 9 03:17:32 EDT 2002


Bruce Mitchener wrote:
> Itamar Shtull-Trauring wrote:
>> Bruce Mitchener wrote:
>>> I've made a couple of local changes to cBanana to look at improving 
>>> the performance of it some.
>>
>> Great! Got any numbers showing the speed difference?
> 
> Nothing reliable.  I was just testing with doc/examples/pbbenchserver.py 
> and pbbenchclient.py and looking at how many calls/second were being made.
> 
> This week, I'm planning on putting together a quick Banana bench and 
> then I'll be able to test it directly and with more predictable loads to 
> exercise the parts that I'm changing. :)
> 
> That'll let me get reliable and useful numbers and do some targeted 
> profiling as well I hope.

So, I wrote this crappy program that works to test decoding from banana:

   http://day.cubik.org/~bruce/bananabench.py

10000 iterations of decoding the banana-encoded form of:

   [1, 2, [3, 4], [30.5, 40.2], 5, ["six", "seven", ["eight", 9]], [10], []]

had these results:

Pure Python:  22.56 seconds
CVS cBanana:   1.15 seconds
My cBanana:    0.98 seconds

Now, that data is list heavy, so it is particularly suited to enjoy the 
benefits of my patch.  But, given the sorts of data that I know we pass 
around at work (not in Twisted), our data is typically pretty list 
heavy.  Glyph said that PB stuff is usually pretty list-heavy as well.

So, that looks to be a gain.

I ran it under valgrind and that didn't seem to turn up any leaks.

Cheers,

  - Bruce





More information about the Twisted-Python mailing list