Log message for revision 115040:
  Avoid key calculation overhead for fast queries
  

Changed:
  U   Zope/branches/andig-catalog-report/src/Products/ZCatalog/CatalogReport.py

-=-
Modified: 
Zope/branches/andig-catalog-report/src/Products/ZCatalog/CatalogReport.py
===================================================================
--- Zope/branches/andig-catalog-report/src/Products/ZCatalog/CatalogReport.py   
2010-07-24 17:50:26 UTC (rev 115039)
+++ Zope/branches/andig-catalog-report/src/Products/ZCatalog/CatalogReport.py   
2010-07-24 17:54:11 UTC (rev 115040)
@@ -187,13 +187,16 @@
         self.log()
 
     def log(self):
-        key = make_key(self.catalog, self.request)
-
         # result of stopwatch
         res = self.result()
         if res[0] < self.threshold:
             return
 
+        # The key calculation takes a bit itself, we want to avoid that for
+        # any fast queries. This does mean that slow queries get the key
+        # calculation overhead added to their runtime.
+        key = make_key(self.catalog, self.request)
+
         reports_lock.acquire()
         try:
             if self.cid not in reports:

_______________________________________________
Zope-Checkins maillist  -  Zope-Checkins@zope.org
https://mail.zope.org/mailman/listinfo/zope-checkins

Reply via email to