[ZODB-Dev] BTree performance characteristics

Tim Peters tim@zope.com
Tue, 16 Jul 2002 20:06:52 -0400


[Toby Dickenson]
> False alarm.... it looks like the difference is down to the order
> in which keys are presented. In my second phase I must be rarely
> hitting the same bucket twice; averaging 1.3 value changes per
> persistent object written.  In the first phase it averages 40
> additions per persistent object written - that is almost unbelievably
> good.

Without knowing anything about your code, I can't guess whether that's good,
bad, or average; e.g., I don't even have a clue about what "a phase" means
here.

In an OI tree, the leaves have a maximum capacity of 60 keys.  If you insert
things wholly at random into this kind of BTree and never delete, the
average fill-factor of a leaf is expected to be about 69% over time (100
times the natural logarithm of 2).  69% of 60 is about 41.  So if that's
what "phase one" is doing, about 40 keys per leaf object is expected.