[Zope] BTreeFolder2 add speed with 10k objects

Dieter Maurer dieter at handshake.de
Tue Oct 21 16:07:36 EDT 2003


Jeff Youel wrote at 2003-10-20 12:02 -0700:
 > I'm using a CMFBTreeFolder to hold objects for a query later.  Each
 > object in the 
 > folder has a few string members.  The folder now has about 10,200
 > objects.  When
 > I add a new instance of the object to the folder, it takes around 18
 > seconds.  
 > I've tracked the hotspot down to BTreeFolder2._setOb()'s:
 > 
 > 	tree[id] = object
 > 
 > which takes around 17 seconds.  By comparison, the rest of the request 
 > including cataloging the object takes less than a second.

That is really astonishing:

  As always for trees, insertion takes time in the order of the tree
  depth, which is logarithmic in the number of tree entries, provided
  the tree is quite balanced.

The "BTrees.check" module has a function "display". You can use
it to display your tree. What be interesting how it looks like.


Dieter



More information about the Zope mailing list