[ZODB-Dev] Latest profile results

Barry A. Warsaw barry@zope.com
Mon, 16 Dec 2002 23:04:55 -0500


>>>>> "GW" == Greg Ward <gward@mems-exchange.org> writes:

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

Not surprising, since I wrote a somewhat similar helper for Full that
gave me a huge win (I don't have the numbers any more).  The big hit
for me was fiddling with refcounts.  In particular, unpacking a
string, adding a delta, then packing back into a string.  The helper
only works for Python 2.2 and beyond because it uses some _Py C funcs
that don't exist in earlier Pythons.

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

    GW>   from packutils import p64, u64, U64

Can you pick something other than packutils?  It sounds like it's
specific to packing a storage, but it's really not.  Hmm, maybe
longutils? ;)

-Barry