[Zodb-checkins] CVS: ZODB3/ZODB/tests - testFileStorage.py:1.19.8.8
Tim Peters
tim.one at comcast.net
Fri Aug 22 17:56:09 EDT 2003
Update of /cvs-repository/ZODB3/ZODB/tests
In directory cvs.zope.org:/tmp/cvs-serv1516/ZODB/tests
Modified Files:
Tag: ZODB3-3_1-branch
testFileStorage.py
Log Message:
Added an oid->serialno in-memory cache to FileStorage. The intent is to
save expensive seeks in several common operations (e.g., getSerial()/
lastSerial() obviously, and .store() needs to fetch serialnos too). With
some luck this will also speed cache verification on reconnects, and
when multiple clients connect via ZEO.
getSerial/lastSerial: it's unclear why these both exist. The former
raised KeyError if oid wasn't known, while the latter returned None,
and that appears to be the only plausibly intended difference. The
latter neglected to acquire the lock before seeking, so that was a bug,
but the latter did better error-checking. So massively rearranged
these, moving everything good above the latter into the former.
Jim noted that I'm more aggressive than necessary about deleting entries
from the new cache in the presence of versions. I'll note that deleting
a cache entry is always safe, and that there are few good version tests
in 3.1. Happy to optimize more later, but there's a lot of time pressure
now, and I don't really understand the version implementation, so "better
safe than sorry" rules.
=== ZODB3/ZODB/tests/testFileStorage.py 1.19.8.7 => 1.19.8.8 ===
--- ZODB3/ZODB/tests/testFileStorage.py:1.19.8.7 Thu Jul 24 14:49:03 2003
+++ ZODB3/ZODB/tests/testFileStorage.py Fri Aug 22 16:56:08 2003
@@ -93,7 +93,7 @@
class OldFileStorage(ZODB.FileStorage.FileStorage):
def _newIndexes(self):
- return {}, {}, {}, {}
+ return {}, {}, {}, {}, {}, {}, {}
from ZODB.fsIndex import fsIndex
@@ -118,7 +118,7 @@
class OldFileStorage(ZODB.FileStorage.FileStorage):
def _newIndexes(self):
- return {}, {}, {}, {}
+ return {}, {}, {}, {}, {}, {}, {}
from ZODB.fsIndex import fsIndex
More information about the Zodb-checkins
mailing list