[Zope-Checkins] CVS: ZODB3/ZEO - simul.py:1.12.8.2.18.12

Tim Peters cvs-admin at zope.org
Thu Dec 4 22:29:15 EST 2003


Update of /cvs-repository/ZODB3/ZEO
In directory cvs.zope.org:/tmp/cvs-serv9804/ZEO

Modified Files:
      Tag: Zope-2_6-branch
	simul.py 
Log Message:
Woo hoo!  Thor's hit rate zooms from 27.2% to 43.8% with a 50MB cache,
and from 55.4% to 68.2% with a 100MB cache, all by throwing away
code <wink>.  The only change is giving all new objects the same
worth (0).  It *was* giving new objects a worth roughly equal to the
base 2 logarithm of their size, which is really an insane thing to do
given the object size distribution ZEO sees.


=== ZODB3/ZEO/simul.py 1.12.8.2.18.11 => 1.12.8.2.18.12 ===
--- ZODB3/ZEO/simul.py:1.12.8.2.18.11	Thu Dec  4 21:43:55 2003
+++ ZODB3/ZEO/simul.py	Thu Dec  4 22:29:14 2003
@@ -1566,20 +1566,9 @@
         self.currentsize += object.size
         object.linkbefore(self.currentobj)
 
-        worth = object.worth
-        if worth is None:
-            # Give new object an intial worth roughly equal to the log
-            # (base 2) of its size.  The intuition is that larger objects
-            # are more expensive to fetch over the network, so are worth
-            # more (at least at first).
-            worth = 0
-            targetsize = 1
-            while object.size > targetsize:
-                worth += 1
-                targetsize <<= 1
-            object.worth = worth
-
-        self.worthsets[worth].add(object)
+        if object.worth is None:
+            object.worth = 0
+        self.worthsets[object.worth].add(object)
 
     # Decrease the worth of the current object, and advance the
     # current object.




More information about the Zope-Checkins mailing list