[Zope-CVS] CVS: Products/ZCTextIndex - Index.py:126.96.36.199
Fri, 3 May 2002 14:58:09 -0400
Update of /cvs-repository/Products/ZCTextIndex
In directory cvs.zope.org:/tmp/cvs-serv16278
Add further comment explaining why IIBTrees are a more efficient
in-memory representation than dictionaries.
=== Products/ZCTextIndex/Index.py 188.8.131.52 => 184.108.40.206 ===
# IIBTree with 10 elts, and 10 happens to be 2/3s of 2**4. So
# choose 10 as the cutoff for now.
+ # The IIBTree has a smaller in-memory representation than a
+ # dictionary, so pickle size isn't the only consideration when
+ # choosing the threshold. The pickle of a 500-elt dict is 92%
+ # of the size of the same IIBTree, but the dict uses more
+ # space when it is live in memory. An IIBTree stores two C
+ # arrays of ints, one for the keys and one for the values. It
+ # holds upto 120 key-value pairs in a single bucket.
map = self._wordinfo[wid]