Commit a93d5669 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

fill cache out of the loop, otherwise the test and its result become too different.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@30470 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 1f120610
...@@ -208,6 +208,8 @@ class TestPerformance(ERP5TypeTestCase, LogInterceptor): ...@@ -208,6 +208,8 @@ class TestPerformance(ERP5TypeTestCase, LogInterceptor):
view_result = {} view_result = {}
tic_result = {} tic_result = {}
add_result = {} add_result = {}
# call view once to fill caches
self.bar_module.BarModule_viewBarList()
# add object in bar module # add object in bar module
for i in xrange(10): for i in xrange(10):
def add(): def add():
...@@ -229,8 +231,6 @@ class TestPerformance(ERP5TypeTestCase, LogInterceptor): ...@@ -229,8 +231,6 @@ class TestPerformance(ERP5TypeTestCase, LogInterceptor):
self.tic() self.tic()
after_tic = time() after_tic = time()
gc.collect() gc.collect()
# call view once to fill caches
self.bar_module.BarModule_viewBarList()
before_form = time() before_form = time()
for x in xrange(100): for x in xrange(100):
self.bar_module.BarModule_viewBarList() self.bar_module.BarModule_viewBarList()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment