[Checkins] SVN: z3c.pt/trunk/ Added more benchmark tests for the
file variants.
Hanno Schlichting
plone at hannosch.info
Sat Jun 14 15:48:28 EDT 2008
Log message for revision 87404:
Added more benchmark tests for the file variants.
Changed:
_U z3c.pt/trunk/benchmark/benchmark/
A z3c.pt/trunk/benchmark/benchmark/input/bigtable_path_z3c.pt
A z3c.pt/trunk/benchmark/benchmark/input/bigtable_path_zope.pt
U z3c.pt/trunk/benchmark/benchmark/tests.py
U z3c.pt/trunk/docs/HISTORY.txt
-=-
Property changes on: z3c.pt/trunk/benchmark/benchmark
___________________________________________________________________
Name: svn:ignore
+ *.pyc
*.pyo
Added: z3c.pt/trunk/benchmark/benchmark/input/bigtable_path_z3c.pt
===================================================================
--- z3c.pt/trunk/benchmark/benchmark/input/bigtable_path_z3c.pt (rev 0)
+++ z3c.pt/trunk/benchmark/benchmark/input/bigtable_path_z3c.pt 2008-06-14 19:48:28 UTC (rev 87404)
@@ -0,0 +1,11 @@
+<table xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:tal="http://xml.zope.org/namespaces/tal"
+ tal:default-expression="path">
+ <tr tal:repeat="row table">
+ <td tal:repeat="c row/values">
+ <span tal:define="d python: c + 1"
+ tal:attributes="class string:column-${d}"
+ tal:content="d" />
+ </td>
+ </tr>
+</table>
Property changes on: z3c.pt/trunk/benchmark/benchmark/input/bigtable_path_z3c.pt
___________________________________________________________________
Name: svn:eol-style
+ native
Added: z3c.pt/trunk/benchmark/benchmark/input/bigtable_path_zope.pt
===================================================================
--- z3c.pt/trunk/benchmark/benchmark/input/bigtable_path_zope.pt (rev 0)
+++ z3c.pt/trunk/benchmark/benchmark/input/bigtable_path_zope.pt 2008-06-14 19:48:28 UTC (rev 87404)
@@ -0,0 +1,10 @@
+<table xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:tal="http://xml.zope.org/namespaces/tal">
+ <tr tal:repeat="row options/table">
+ <td tal:repeat="c row/values">
+ <span tal:define="d python: c + 1"
+ tal:attributes="class string:column-${d}"
+ tal:content="d" />
+ </td>
+ </tr>
+</table>
Property changes on: z3c.pt/trunk/benchmark/benchmark/input/bigtable_path_zope.pt
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: z3c.pt/trunk/benchmark/benchmark/tests.py
===================================================================
--- z3c.pt/trunk/benchmark/benchmark/tests.py 2008-06-14 19:27:53 UTC (rev 87403)
+++ z3c.pt/trunk/benchmark/benchmark/tests.py 2008-06-14 19:48:28 UTC (rev 87404)
@@ -182,6 +182,38 @@
print "zope.pagetemplate: %.2f" % t_zope
print " %.2fX" % (t_zope/t_z3c)
+ @benchmark(u"Big table (path) File")
+ def testBigTablePathFile(self):
+ table = self.table
+
+ files = os.path.abspath(os.path.join(__file__, '..', 'input'))
+ def testfile(name):
+ return os.path.join(files, name)
+
+ z3cfile = z3c.pt.PageTemplateFile(
+ testfile('bigtable_path_z3c.pt'))
+
+ zopefile = zope.pagetemplate.pagetemplatefile.PageTemplateFile(
+ testfile('bigtable_path_zope.pt'))
+
+ t_z3c = timing(z3cfile.render, table=table, request=object())
+ t_zope = timing(zopefile, table=table, request=object())
+
+ print "z3c.pt: %.2f" % t_z3c
+ print "zope.pagetemplate: %.2f" % t_zope
+ print " %.2fX" % (t_zope/t_z3c)
+
+ print "--------------------------"
+ print " Second rendering"
+ print "--------------------------"
+
+ t_z3c = timing(z3cfile.render, table=table, request=object())
+ t_zope = timing(zopefile, table=table, request=object())
+
+ print "z3c.pt: %.2f" % t_z3c
+ print "zope.pagetemplate: %.2f" % t_zope
+ print " %.2fX" % (t_zope/t_z3c)
+
# Use a custom context to add real i18n lookup
from zope.i18n import translate
Modified: z3c.pt/trunk/docs/HISTORY.txt
===================================================================
--- z3c.pt/trunk/docs/HISTORY.txt 2008-06-14 19:27:53 UTC (rev 87403)
+++ z3c.pt/trunk/docs/HISTORY.txt 2008-06-14 19:48:28 UTC (rev 87404)
@@ -4,6 +4,8 @@
Version 0.8.x
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+- Added more benchmark tests for the file variants.
+
- Optimized 'is None' handling in Tag clause similar to the Write clause.
- Made the _out.write method directly available as _write in all scopes, so
More information about the Checkins
mailing list