Commit 9b599fb9 authored by Guido van Rossum's avatar Guido van Rossum

Improve (I *think*) the size estimates by at least filling in the

correct header sizes.
parent 932bb8b1
......@@ -53,9 +53,10 @@ class TransactionBuffer:
self.pickler.dump((oid, version, data))
self.count += 1
# Estimate per-record cache size
self.size = self.size + len(data) + (27 + 12)
self.size = self.size + len(data) + 31
if version:
self.size = self.size + len(version) + 4
# Assume version data has same size as non-version data
self.size = self.size + len(version) + len(data) + 12
def invalidate(self, oid, version):
self.pickler.dump((oid, version, None))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment