From e0df2a214f6404b41073127ed4b8b52cbb1f6380 Mon Sep 17 00:00:00 2001 From: "R. Tyler Ballance" Date: Wed, 14 Oct 2009 22:36:59 -0700 Subject: Add a simple test to help judge perfomance of DummyTransaction.write() --- cheetah/Tests/Performance.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) 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 = ''' -- cgit v1.2.1