summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorR. Tyler Ballance <tyler@monkeypox.org>2009-10-14 22:36:59 -0700
committerR. Tyler Ballance <tyler@monkeypox.org>2009-10-14 22:36:59 -0700
commite0df2a214f6404b41073127ed4b8b52cbb1f6380 (patch)
treeaa5a27816ec30ef67f90ff70fa1f8a075691603e
parente8d6782076e0d582d0090c7cef6239f6d72efcd0 (diff)
downloadpython-cheetah-e0df2a214f6404b41073127ed4b8b52cbb1f6380.tar.gz
Add a simple test to help judge perfomance of DummyTransaction.write()
-rw-r--r--cheetah/Tests/Performance.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/cheetah/Tests/Performance.py b/cheetah/Tests/Performance.py
index 3dcd8c5..8101e85 100644
--- a/cheetah/Tests/Performance.py
+++ b/cheetah/Tests/Performance.py
@@ -123,6 +123,23 @@ class DynamicMethodCompilationTest(PerformanceTest):
template = template()
value = template.testMethod()
+
+class BunchOfWriteCalls(PerformanceTest):
+ iterations = 1000
+ def performanceSample(self):
+ template = '''
+ #import sys
+ #import os
+ #for i in xrange(1000)
+ $i
+ #end for
+ '''
+ template = Cheetah.Template.Template.compile(template,
+ keepRefToGeneratedCode=False)
+ template = template()
+ value = template.respond()
+ del value
+
class DynamicSimpleCompilationTest(PerformanceTest):
def performanceSample(self):
template = '''