Ñò 9ÝoLc @ sô d d k Z d d k Z d d k Z d d k Z d d k Z d d k l Z d d k Z d d k Z d d k Z e a d Z d e Z d e f d „ ƒ YZ d a d „ Z d d „ Z d e i f d „ ƒ YZ d e i f d „ ƒ YZ d e f d „ ƒ YZ d e f d „ ƒ YZ d e f d „ ƒ YZ d e f d „ ƒ YZ d e f d „ ƒ YZ d e f d „ ƒ YZ d e f d „ ƒ YZ e d j o` d e i j oB e! a g Z" e i D] Z# e# d j p e" e# q´q´[" e _ n e i$ ƒ n d S( iÿÿÿÿN( t pystoneiè g à?t DurationErrorc B s e Z RS( ( t __name__t __module__( ( ( s? /usr/lib64/python2.6/site-packages/Cheetah/Tests/Performance.pyR s c C s$ t p t i d t i ƒ a n t S( Nt loops( t _pystone_calibration_markR t pystonest LOOPS( ( ( s? /usr/lib64/python2.6/site-packages/Cheetah/Tests/Performance.pyt _pystone_calibration s c sJ t ˆ t ƒ p t ˆ ƒ ‰ n ˆ p t ƒ ‰ n ‡ ‡ f d † } | S( s° Performance test decorator based off the 'timedtest' decorator found in this Active State recipe: http://code.activestate.com/recipes/440700/ c s ‡ ‡ ‡ f d † } | S( Nc s° t i ƒ } z ˆ | | Ž SWd t i ƒ | } | d j o d } n ˆ d ˆ d } | | } t o d ˆ i | f GHn, | ˆ t j o t d | ˆ f ƒ ‚ n Xd S( Ni i s The test "%s" took: %s pystoness- Test too long (%.2f Ps, need at most %.2f Ps)( t timet DEBUGt func_namet TOLERANCER ( t argst kwt start_timet total_timet pystone_total_timet pystone_rate( t functiont current_pystonet max_num_pystones( s? /usr/lib64/python2.6/site-packages/Cheetah/Tests/Performance.pyt wrapper. s ( ( R R ( R R ( R s? /usr/lib64/python2.6/site-packages/Cheetah/Tests/Performance.pyt _test- s ( t isinstancet floatR ( R R R ( ( R R s? /usr/lib64/python2.6/site-packages/Cheetah/Tests/Performance.pyt perftest! s t DynamicTemplatePerformanceTestc B s) e Z d Z d „ Z e d ƒ e ƒ Z RS( i c C sG d } x: t | i ƒ D]) } t i i i | ƒ } | p t ‚ q Wd S( NsU #def foo(arg1, arg2) #pass #end def ( t rangeR t Cheetaht Templatet compilet AssertionError( t selft templatet it klass( ( s? /usr/lib64/python2.6/site-packages/Cheetah/Tests/Performance.pyt test_BasicDynamicJ s i° ( R R R R% R ( ( ( s? /usr/lib64/python2.6/site-packages/Cheetah/Tests/Performance.pyR G s t PerformanceTestc B s# e Z d Z e Z e Z d „ Z RS( i † c C s t i d | i i ƒ | _ | i i ƒ x> t | i ƒ D]- } t | d ƒ o t | _ | i ƒ q9 q9 W| i i ƒ | i i ƒ | i oU d | i i | i f GHt i i d | i i ƒ } | i d d ƒ | i d ƒ n | i p t i d | i i ƒ n d S( Ns %s.proft performanceSamples >>> %s (%d iterations) R t callsi2 ( t hotshott Profilet __class__R t proft startR t iterationst hasattrt Truet displayR' t stopt closet statst loadt sort_statst print_statst savet ost unlink( R! R# R4 ( ( s? /usr/lib64/python2.6/site-packages/Cheetah/Tests/Performance.pyt runTestZ s" ( R R R. t FalseR1 R8 R; ( ( ( s? /usr/lib64/python2.6/site-packages/Cheetah/Tests/Performance.pyR&