[Erp5-report] r21167 - /erp5/trunk/products/ERP5Type/tests/testPerformance.py

nobody at svn.erp5.org nobody at svn.erp5.org
Tue May 27 13:40:15 CEST 2008


Author: vincent
Date: Tue May 27 13:40:13 2008
New Revision: 21167

URL: http://svn.erp5.org?rev=21167&view=rev
Log:
Only disable GC when a test is run, to avoid disabling GC for everybody importing the file. I'm not sure if GC should be re-enabled at tear down, and prefer not to do so for the moment.

Modified:
    erp5/trunk/products/ERP5Type/tests/testPerformance.py

Modified: erp5/trunk/products/ERP5Type/tests/testPerformance.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/tests/testPerformance.py?rev=21167&r1=21166&r2=21167&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Type/tests/testPerformance.py (original)
+++ erp5/trunk/products/ERP5Type/tests/testPerformance.py Tue May 27 13:40:13 2008
@@ -53,17 +53,6 @@
 LISTBOX_COEF=0.02472
 DO_TEST = 1
 
-# Prevent GC from happening.
-# We don't want cpu time to be spent outside of python code if possible.
-# It would increase the "crosstalk" between using more ram and using more cpu.
-# Another problem is that it makes result even less reproductible on another
-# machine where memory use does not evolve identicaly (ie. x86_64 arch,
-# because of 64bits pointers).
-gc.disable()
-# XXX: Maybe it would be usefull to explicitely collect garbage in some places
-# to keep memory usage low. But it is generaly bad to apply the cure before
-# even knowing if the symptoms will show up.
-
 class TestPerformance(ERP5TypeTestCase, LogInterceptor):
 
     # Some helper methods
@@ -90,6 +79,16 @@
       """
         Executed before each test_*.
       """
+      # Prevent GC from happening.
+      # We don't want cpu time to be spent outside of python code if possible.
+      # It would increase the "crosstalk" between using more ram and using more cpu.
+      # Another problem is that it makes result even less reproductible on another
+      # machine where memory use does not evolve identicaly (ie. x86_64 arch,
+      # because of 64bits pointers).
+      gc.disable()
+      # XXX: Maybe it would be usefull to explicitely collect garbage in some places
+      # to keep memory usage low. But it is generaly bad to apply the cure before
+      # even knowing if the symptoms will show up.
       self.login()
       self.bar_module = self.getBarModule()
       self.foo_module = self.portal.foo_module




More information about the Erp5-report mailing list