[ZODB-Dev] Latest profile results

Greg Ward gward@mems-exchange.org
Mon, 16 Dec 2002 21:26:09 -0500


Right, I've done enough profiling, so I started writing code.  Started
with the easiest nut to crack: rewrite p64(), u64(), and U64() in C.
The results are most pleasant: opening an index-less FileStorage went
from ~30 sec elapsed time to ~16 sec.  Woo-hoo!  I was expected a win,
but not that much!

The implementation consists of ZODB/packutils.c, a bit under 200 lines
of C code (with some trimming to go) and replacing most of ZODB/utils.py
with

  from packutils import p64, u64, U64

I haven't done anything about making u64() and U64() equivalent under
Python 2.2, since the current code doesn't actually do that (despite an
obvious intention of doing so).

I also added some more tests to ZODB/tests/testUtils.py just to be sure
everything was hunky-dory.

Since I did this on work time, I'd probably better ask for permission
before releasing the patch.  ;-(  Jeremy, what's your schedule for
releasing 3.1.1?  Or would you rather see a patch that depends on the C
compiler/library handling unsigned 64-bit integers get some more testing
first?  ;-)

        Greg
-- 
Greg Ward - software developer                gward@mems-exchange.org
MEMS Exchange                            http://www.mems-exchange.org