[Erp5-report] r29955 - /erp5/trunk/products/ERP5Type/tests/testPerformance.py
nobody at svn.erp5.org
nobody at svn.erp5.org
Fri Oct 23 09:29:53 CEST 2009
Author: kazuhiko
Date: Fri Oct 23 09:29:52 2009
New Revision: 29955
URL: http://svn.erp5.org?rev=29955&view=rev
Log:
get more profile results if PROFILE=1.
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=29955&r1=29954&r2=29955&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Type/tests/testPerformance.py [utf8] (original)
+++ erp5/trunk/products/ERP5Type/tests/testPerformance.py [utf8] Fri Oct 23 09:29:52 2009
@@ -189,15 +189,23 @@
add_result = {}
# add object in bar module
for i in xrange(10):
+ def add():
+ for x in xrange(100):
+ p = self.bar_module.newContent(portal_type='Bar',
+ title='Bar Test',
+ quantity="%4d" %(x,))
before_add = time()
- for x in xrange(100):
- p = self.bar_module.newContent(portal_type='Bar',
- title='Bar Test',
- quantity="%4d" %(x,))
+ if PROFILE:
+ self.profile(add, i)
+ else:
+ add()
after_add = time()
transaction.commit()
before_tic = time()
- self.tic()
+ if PROFILE:
+ self.profile(self.tic, i)
+ else:
+ self.tic()
after_tic = time()
gc.collect()
before_form = time()
@@ -276,6 +284,8 @@
( MIN_OBJECT_PROXYFIELD_VIEW,
req_time,
MAX_OBJECT_PROXYFIELD_VIEW )
+ if PROFILE:
+ self.profile(foo.Foo_viewProxyField)
if DO_TEST:
self.failUnless( MIN_OBJECT_PROXYFIELD_VIEW < req_time
< MAX_OBJECT_PROXYFIELD_VIEW,
More information about the Erp5-report
mailing list