ó Û¶eTc@sãddlZddlZddlZddlZddlZddlmZddlZddlZ ddl Z e a dZ de Zdefd„ƒYZdad„Zdd„Zd ejfd „ƒYZd ejfd „ƒYZd efd„ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZedkrßdej krÒe!a gej D]Z"e"dks®e"^q®e_ nej#ƒndS(iÿÿÿÿN(tpystoneiègà?t DurationErrorcBseZRS((t__name__t __module__(((sH/opt/freeware/lib64/python2.7/site-packages/Cheetah/Tests/Performance.pyRscCs"tstjdtjƒantS(Ntloops(t_pystone_calibration_markRtpystonestLOOPS(((sH/opt/freeware/lib64/python2.7/site-packages/Cheetah/Tests/Performance.pyt_pystone_calibrationscsFtˆtƒstˆƒ‰nˆs0tƒ‰n‡‡fd†}|S(s° Performance test decorator based off the 'timedtest' decorator found in this Active State recipe: http://code.activestate.com/recipes/440700/ cs‡‡‡fd†}|S(Ncsªtjƒ}zˆ||ŽSWdtjƒ|}|dkrEd}nˆdˆd}||}tr|dˆj|fGHn)|ˆtkr¥td|ˆfƒ‚nXdS(NiisThe test "%s" took: %s pystoness-Test too long (%.2f Ps, need at most %.2f Ps)(ttimetDEBUGt func_namet TOLERANCER(targstkwt start_timet total_timetpystone_total_timet pystone_rate(tcurrent_pystonetfunctiontmax_num_pystones(sH/opt/freeware/lib64/python2.7/site-packages/Cheetah/Tests/Performance.pytwrapper/s      ((RR(RR(RsH/opt/freeware/lib64/python2.7/site-packages/Cheetah/Tests/Performance.pyt_test.s(t isinstancetfloatR(RRR((RRsH/opt/freeware/lib64/python2.7/site-packages/Cheetah/Tests/Performance.pytperftest"s  tDynamicTemplatePerformanceTestcBs)eZdZd„ZedƒeƒZRS(i cCs9d}x,t|jƒD]}tjjj|ƒ}qWdS(NsU #def foo(arg1, arg2) #pass #end def (trangeRtCheetahtTemplatetcompile(tselfttemplatetitklass((sH/opt/freeware/lib64/python2.7/site-packages/Cheetah/Tests/Performance.pyttest_BasicDynamicKsi°(RRRR$R(((sH/opt/freeware/lib64/python2.7/site-packages/Cheetah/Tests/Performance.pyRHs tPerformanceTestcBs#eZdZeZeZd„ZRS(i †cCstjd|jjƒ|_|jjƒx<t|jƒD]+}t|dƒr9t |_ |j ƒq9q9W|jj ƒ|jj ƒ|j rßd|jj|jfGHtjjd|jjƒ}|jddƒ|jdƒn|jstjd|jjƒndS(Ns%s.proftperformanceSamples>>> %s (%d iterations) R tcallsi2(thotshottProfilet __class__RtproftstartRt iterationsthasattrtTruetdisplayR&tstoptclosetstatstloadt sort_statst print_statstsavetostunlink(R R"R3((sH/opt/freeware/lib64/python2.7/site-packages/Cheetah/Tests/Performance.pytrunTest[s         (RRR-tFalseR0R7R:(((sH/opt/freeware/lib64/python2.7/site-packages/Cheetah/Tests/Performance.pyR%VstDynamicMethodCompilationTestcBseZd„ZRS(cCs:d}tjjj|dtƒ}|ƒ}|jƒ}dS(Ns³ #import sys #import os #def testMethod() #set foo = [1, 2, 3, 4] #return $foo[0] #end def tkeepRefToGeneratedCode(RRRR;t testMethod(R R!tvalue((sH/opt/freeware/lib64/python2.7/site-packages/Cheetah/Tests/Performance.pyR&ps   (RRR&(((sH/opt/freeware/lib64/python2.7/site-packages/Cheetah/Tests/Performance.pyR<ostBunchOfWriteCallscBseZdZd„ZRS(iècCs=d}tjjj|dtƒ}|ƒ}|jƒ}~dS(Ns‚ #import sys #import os #for i in range(1000) $i #end for R=(RRRR;trespond(R R!R?((sH/opt/freeware/lib64/python2.7/site-packages/Cheetah/Tests/Performance.pyR&s    (RRR-R&(((sH/opt/freeware/lib64/python2.7/site-packages/Cheetah/Tests/Performance.pyR@stDynamicSimpleCompilationTestcBseZd„ZRS(cCs:d}tjjj|dtƒ}|ƒ}t|ƒ}dS(Ns® #import sys #import os #set foo = [1,2,3,4] Well hello there! This is basic. Here's an array too: $foo R=(RRRR;tunicode(R R!((sH/opt/freeware/lib64/python2.7/site-packages/Cheetah/Tests/Performance.pyR&s   (RRR&(((sH/opt/freeware/lib64/python2.7/site-packages/Cheetah/Tests/Performance.pyRBst FilterTestcBs eZdZd„Zd„ZRS(cCsDtt|ƒjƒd}tjjj|dtƒ}|ƒ|_dS(Nsz #import sys #import os #set foo = [1, 2, 3, 4] $foo, $foo, $foo R=(tsuperRDtsetUpRRRR;R!(R R!((sH/opt/freeware/lib64/python2.7/site-packages/Cheetah/Tests/Performance.pyRF¢s  cCst|jƒ}dS(N(RCR!(R R?((sH/opt/freeware/lib64/python2.7/site-packages/Cheetah/Tests/Performance.pyR&¯sN(RRtNoneR!RFR&(((sH/opt/freeware/lib64/python2.7/site-packages/Cheetah/Tests/Performance.pyRD s tLongCompileTestcBs eZdZd„Zd„ZRS(s7 Test the compilation on a sufficiently large template cCstjjj|dtƒS(NR=(RRRR;(R R!((sH/opt/freeware/lib64/python2.7/site-packages/Cheetah/Tests/Performance.pyRµscCsd}|j|ƒS(Nsá #import sys #import Cheetah.Template #extends Cheetah.Template.Template #def header()

This is my header

#end def #def footer() #return "Huzzah" #end def #def scripts() #pass #end def #def respond() ${title} $scripts() $header() #for $i in $range(10) This is just some stupid page!
#end for
$footer() #end def (R(R R!((sH/opt/freeware/lib64/python2.7/site-packages/Cheetah/Tests/Performance.pyR&¸s((RRt__doc__RR&(((sH/opt/freeware/lib64/python2.7/site-packages/Cheetah/Tests/Performance.pyRH³s t LongCompile_CompilerSettingsTestcBseZd„ZRS(cCs-tjjj|dtditd6td6ƒS(NR=tcompilerSettingstuseStackFramestuseAutocalling(RRRR;R/(R R!((sH/opt/freeware/lib64/python2.7/site-packages/Cheetah/Tests/Performance.pyRäs(RRR(((sH/opt/freeware/lib64/python2.7/site-packages/Cheetah/Tests/Performance.pyRJãstLongCompileAndRuncBseZd„ZRS(cCs>tt|ƒjƒ}|didd6gƒ}|jƒ}dS(Nt searchListtfoottitle(RERNR&RA(R R!((sH/opt/freeware/lib64/python2.7/site-packages/Cheetah/Tests/Performance.pyR&és(RRR&(((sH/opt/freeware/lib64/python2.7/site-packages/Cheetah/Tests/Performance.pyRNèst__main__s--debug($R(t hotshot.statsR8tsystunittestttestRR tCheetah.NameMapperRtCheetah.TemplateR;R tkPSR tAssertionErrorRRGRRRtTestCaseRR%R<R@RBRDRHRJRNRtargvR/targtmain(((sH/opt/freeware/lib64/python2.7/site-packages/Cheetah/Tests/Performance.pyts:           &0 .