[Checkins] SVN: zc.buildout/branches/env-cache/ Turns out this optimization isn't relevant under 1.5. Reverting as

Ross Patterson me at rpatterson.net
Sun Jan 29 05:22:25 UTC 2012


Log message for revision 124230:
  Turns out this optimization isn't relevant under 1.5.  Reverting as
  already done on trunk.

Changed:
  U   zc.buildout/branches/env-cache/CHANGES.txt
  U   zc.buildout/branches/env-cache/src/zc/buildout/easy_install.py

-=-
Modified: zc.buildout/branches/env-cache/CHANGES.txt
===================================================================
--- zc.buildout/branches/env-cache/CHANGES.txt	2012-01-28 21:33:54 UTC (rev 124229)
+++ zc.buildout/branches/env-cache/CHANGES.txt	2012-01-29 05:22:24 UTC (rev 124230)
@@ -7,10 +7,6 @@
 - Cache the pkg_resources.Environment instances for performance
   optimizations.  (rossp)
 
-- Avoid sorting the working set and requirements when it won't be
-  logged.  To see the benefit be sure to run without any increase in
-  verbosity ("-v" option).  (rossp)
-
 - The buildout init command now accepts distribution requirements and
   paths to set up a custom interpreter part that has the distributions
   or parts in the path. For example::

Modified: zc.buildout/branches/env-cache/src/zc/buildout/easy_install.py
===================================================================
--- zc.buildout/branches/env-cache/src/zc/buildout/easy_install.py	2012-01-28 21:33:54 UTC (rev 124229)
+++ zc.buildout/branches/env-cache/src/zc/buildout/easy_install.py	2012-01-29 05:22:24 UTC (rev 124230)
@@ -1870,15 +1870,6 @@
         return "Couldn't find a distribution for %r." % str(req)
 
 def _log_requirement(ws, req):
-    if not logger.isEnabledFor(logging.DEBUG):
-        # Sorting the working set and iterating over it's requirements
-        # is expensive, so short cirtuit the work if it won't even be
-        # logged.  When profiling a simple buildout with 10 parts with
-        # identical and large working sets, this resulted in a
-        # decrease of run time from 93.411 to 15.068 seconds, about a
-        # 6 fold improvement.
-        return
-    
     ws = list(ws)
     ws.sort()
     for dist in ws:



More information about the checkins mailing list