[ZODB-Dev] PersistentMapping good for large numbers of objects?
Tim Peters
tim at zope.com
Tue Jul 22 18:40:13 EDT 2003
[Shane Hathaway]
> How about a combination of the above suggestions: every operation that
> mutates a BTree could look for an attribute of the BTree called
> "length".
Wow -- I've been looking for ways to slow BTrees, and this one didn't even
occur to me <wink>.
> If it's there, the mutating operation could call length.changed
> (deltaLength). Also, the __len__ slot could delegate to the length
> object. That way, we don't have to wrap the BTree just to get a
> minor (but nice) feature.
A practical snag is that "a BTree" doesn't exist as such -- it's a
(potentially very large) collection of BTree and Bucket nodes, and nothing
at all distinguishes the root BTree node (which alone is "the BTree" from a
program's POV, but that's an illusion, and mutations *actually* occur in
Buckets, not in BTree nodes).
More information about the ZODB-Dev
mailing list