[Checkins] SVN: z3c.pt/trunk/ Fixed cached compilation benchmark.
Malthe Borch
mborch at gmail.com
Thu Nov 27 18:56:07 EST 2008
Log message for revision 93411:
Fixed cached compilation benchmark.
Changed:
U z3c.pt/trunk/benchmark/benchmark/tests.py
D z3c.pt/trunk/cache/
-=-
Modified: z3c.pt/trunk/benchmark/benchmark/tests.py
===================================================================
--- z3c.pt/trunk/benchmark/benchmark/tests.py 2008-11-27 18:03:27 UTC (rev 93410)
+++ z3c.pt/trunk/benchmark/benchmark/tests.py 2008-11-27 23:56:07 UTC (rev 93411)
@@ -34,7 +34,7 @@
func(*args, **kwargs)
i += 1
t2 = time.time()
- return 100*(t2-t1)/i
+ return float(100*(t2-t1))/i
def bigtable_python_lxml(table=None):
root = etree.Element("html")
@@ -193,17 +193,22 @@
self._testfile('bigtable_python_z3c.pt'))
z3cfile.registry = filecache.TemplateCache(z3cfile.filename)
z3cfile.registry.purge()
- z3cfile.cook_check(parameters=())
- assert len(z3cfile.registry) == 1
- z3cfile.registry.save()
-
+
zopefile = zope.pagetemplate.pagetemplatefile.PageTemplateFile(
self._testfile('bigtable_python_zope.pt'))
+ # make sure both templates are fully prepared
+ len(zopefile(table=table))
+ len(z3cfile(table=table))
+
+ # save registry
+ assert len(z3cfile.registry) == 1
+ z3cfile.registry.save()
+
t_cached_z3c = timing(z3cfile.registry.load)
t_cook_z3c = timing(z3cfile.cook, parameters=('table',))
t_zope = timing(zopefile._cook)
-
+
print "z3c.pt cooking: %.3f" % t_cook_z3c
print "--------------------------"
print "z3c.pt cached: %.3f" % t_cached_z3c
More information about the Checkins
mailing list