[Zodb-checkins] CVS: ZODB3/ZODB - fspack.py:1.3
Jeremy Hylton
jeremy at zope.com
Fri May 2 19:08:47 EDT 2003
Update of /cvs-repository/ZODB3/ZODB
In directory cvs.zope.org:/tmp/cvs-serv29389
Modified Files:
fspack.py
Log Message:
Use fsindex for oid2curpos and oid2verpos.
Reduces memory usage during pack by a considerable fraction with
modest 10% slowdown.
=== ZODB3/ZODB/fspack.py 1.2 => 1.3 ===
--- ZODB3/ZODB/fspack.py:1.2 Fri May 2 10:50:39 2003
+++ ZODB3/ZODB/fspack.py Fri May 2 18:08:46 2003
@@ -412,8 +412,8 @@
self.packtime = packtime
# packpos: position of first txn header after pack time
self.packpos = None
- self.oid2curpos = {} # maps oid to current data record position
- self.oid2verpos = {} # maps oid to current version data
+ self.oid2curpos = fsIndex() # maps oid to current data record position
+ self.oid2verpos = fsIndex() # maps oid to current version data
# The set of reachable revisions of each object.
#
@@ -445,6 +445,10 @@
self.buildPackIndex()
self.findReachableAtPacktime([z64])
self.findReachableFromFuture()
+ # These mappings are no longer needed and may consume a lot
+ # of space.
+ del self.oid2verpos
+ del self.oid2curpos
def buildPackIndex(self):
pos = 4
More information about the Zodb-checkins
mailing list