-í
è¶<c       s©    d  Z  ! # d Z % d k l Z ' d Z ) e d d ƒ \ Z Z Z Z	 Z
 + d f  d „  ƒ  YZ 9 d Z : d Z < d	 „  Z C e d
 „ Z F d a G e a H d a I d a J d g d a K e d „  t g d ƒ a L e a M e a O e d „ Z … d „  Z • d „  Z   d „  Z ª d „  Z ± d „  Z ¸ d „  Z  Ë d „  Z! Ğ d „  Z" İ d „  Z# å d „  Z$ ö d „  Z% û e& d j o ü e ƒ  n d S(   sâ  
"PYSTONE" Benchmark Program

Version:        Python/1.1 (corresponds to C/1.1 plus 2 Pystone fixes)

Author:         Reinhold P. Weicker,  CACM Vol 27, No 10, 10/84 pg. 1013.

                Translated from ADA to C by Rick Richardson.
                Every method to preserve ADA-likeness has been used,
                at the expense of C-ness.

                Translated from C to Python by Guido van Rossum.

Version History:

                Version 1.1 corrects two bugs in version 1.0:

                First, it leaked memory: in Proc1(), NextRecord ends
                up having a pointer to itself.  I have corrected this
                by zapping NextRecord.PtrComp at the end of Proc1().

                Second, Proc3() used the operator != to compare a
                record to None.  This is rather inefficient and not
                true to the intention of the original benchmark (where
                a pointer comparison to None is intended; the !=
                operator attempts to find a method __cmp__ to do value
                comparison of the record).  Version 1.1 runs 5-10
                percent faster than version 1.0, so benchmark figures
                of different versions can't be compared directly.

i'  (   s   clocks   1.1i   i   s   Recordc      s2   + t  Z - e d d d d d „ Z 5 d „  Z RS(   Ni    c    sC   - / | |  _  0 | |  _ 1 | |  _ 2 | |  _ 3 | |  _ d  S(   N(   s   PtrComps   selfs   Discrs   EnumComps   IntComps
   StringComp(   s   selfs   PtrComps   Discrs   EnumComps   IntComps
   StringComp(    (    s"   /usr/lib/python2.2/test/pystone.pys   __init__- s
   c    s2   5 6 t  |  i |  i |  i 7 |  i |  i ƒ Sd  S(   N(   s   Records   selfs   PtrComps   Discrs   EnumComps   IntComps
   StringComp(   s   self(    (    s"   /usr/lib/python2.2/test/pystone.pys   copy5 s   (   s   __name__s
   __module__s   Nones   __init__s   copy(    (    (    s"   /usr/lib/python2.2/test/pystone.pys   Record+ s   	i    c     s:   < = t  ƒ  \ } }  > d t t | f GH@ d |  GHd  S(   Ns#   Pystone(%s) time for %d passes = %gs-   This machine benchmarks at %g pystones/second(   s   pystoness	   benchtimes   stoness   __version__s   LOOPS(   s   stoness	   benchtime(    (    s"   /usr/lib/python2.2/test/pystone.pys   main< s   c    s   C D t  |  ƒ Sd  S(   N(   s   Proc0s   loops(   s   loops(    (    s"   /usr/lib/python2.2/test/pystone.pys   pystonesC s   s    i3   c    s   K |  S(   N(   s   x(   s   x(    (    s"   /usr/lib/python2.2/test/pystone.pys   <lambda>K s    c    sy  O P Q R S T U V W Y t  ƒ  }
 Z x t |  ƒ DZ ]	 } [ q7 W\ t  ƒ  |
 } ^ t ƒ  a _ t ƒ  a ` t t _	 a t
 t _ b t t _ c d t _ d d t _ e d } f d t d d <h t  ƒ  }
 j xyt |  ƒ Dj ]h} k t ƒ  l t ƒ  m d } n d } o d	 } p t } q t | | ƒ a r xE r | | j  o4 s d
 | | } t t | | ƒ } u | d } q;Wv t t t | | ƒ w t t ƒ a x d } y xZ y | t! j oI z | t" | d ƒ j o { t# t
 ƒ } n | t$ t% | ƒ d ƒ } q´W} | | } ~ | | }  d | | | } € t& | ƒ } qá W‚ t  ƒ  |
 | }	 ƒ |	 |  |	 f Sd  S(   Ni(   s   DHRYSTONE PROGRAM, SOME STRINGs   DHRYSTONE PROGRAM, 1'ST STRINGi
   i   i   i   i   s   DHRYSTONE PROGRAM, 2'ND STRINGi   i   s   As   C((   s   clocks	   starttimes   ranges   loopss   is   nulltimes   Records
   PtrGlbNexts   PtrGlbs   PtrComps   Ident1s   Discrs   Ident3s   EnumComps   IntComps
   StringComps
   String1Locs
   Array2Globs   Proc5s   Proc4s   IntLoc1s   IntLoc2s
   String2Locs   Ident2s   EnumLocs   Func2s   BoolGlobs   IntLoc3s   Proc7s   Proc8s
   Array1Globs   Proc1s	   CharIndexs	   Char2Globs   Func1s   Proc6s   chrs   ords   Proc2s	   benchtime(   s   loopss
   String1Locs   IntLoc2s   IntLoc1s
   String2Locs   IntLoc3s   EnumLocs	   CharIndexs   is	   benchtimes	   starttimes   nulltime(    (    s"   /usr/lib/python2.2/test/pystone.pys   Proc0O sf    		 	

				 	 c    sİ   … † t  i ƒ  |  _ } ‡ d |  _ ˆ |  i | _ ‰ |  i | _ Š t | i ƒ | _ ‹ | i t j oL Œ d | _  t	 |  i
 ƒ | _
  t  i | _  t | i d ƒ | _ n ‘ | i ƒ  }  ’ t | _ “ |  Sd  S(   Ni   i   i
   (   s   PtrGlbs   copys   PtrParIns   PtrComps
   NextRecords   IntComps   Proc3s   Discrs   Ident1s   Proc6s   EnumComps   Proc7s   None(   s   PtrParIns
   NextRecord(    (    s"   /usr/lib/python2.2/test/pystone.pys   Proc1… s   c    s   • – |  d } — x^ — d oS ˜ t d j o' ™ | d } š | t }  › t } n œ | t j o  Pn q W |  Sd  S(   Ni
   i   s   A(   s   IntParIOs   IntLocs	   Char1Globs   IntGlobs   Ident1s   EnumLoc(   s   IntParIOs   EnumLocs   IntLoc(    (    s"   /usr/lib/python2.2/test/pystone.pys   Proc2• s    
c    sO     ¡ £ t  t j	 o ¤ t  i }  n
 ¦ d a § t d t ƒ t  _ ¨ |  Sd  S(   Nid   i
   (   s   PtrGlbs   Nones   PtrComps	   PtrParOuts   IntGlobs   Proc7s   IntComp(   s	   PtrParOut(    (    s"   /usr/lib/python2.2/test/pystone.pys   Proc3  s   	c     s2   ª « ­ t  d j }  ® |  p t }  ¯ d a d  S(   Ns   As   B(   s	   Char1Globs   BoolLocs   BoolGlobs	   Char2Glob(   s   BoolLoc(    (    s"   /usr/lib/python2.2/test/pystone.pys   Proc4ª s   c      s   ± ² ³ µ d a  ¶ t a d  S(   Ns   A(   s	   Char1Globs   FALSEs   BoolGlob(    (    (    s"   /usr/lib/python2.2/test/pystone.pys   Proc5± s   	c    sİ   ¸ ¹ |  } º t |  ƒ o » t } n ¼ |  t j o ½ t } nŒ ¾ |  t j o* ¿ t d j o À t } n
 Â t } nR Ã |  t j o Ä t } n5 Å |  t j o Æ n Ç |  t j o È t } n É | Sd  S(   Nid   (	   s	   EnumParIns
   EnumParOuts   Func3s   Ident4s   Ident1s   Ident2s   IntGlobs   Ident3s   Ident5(   s	   EnumParIns
   EnumParOut(    (    s"   /usr/lib/python2.2/test/pystone.pys   Proc6¸ s    	c    s(   Ë Ì |  d } Í | | } Î | Sd  S(   Ni   (   s   IntParI1s   IntLocs   IntParI2s	   IntParOut(   s   IntParI1s   IntParI2s	   IntParOuts   IntLoc(    (    s"   /usr/lib/python2.2/test/pystone.pys   Proc7Ë s   c    sÆ   Ğ Ñ Ó | d } Ô | |  | <Õ |  | |  | d <Ö | |  | d <× x/ t | | d ƒ D× ] } Ø | | | | <q] WÙ | | | d d | | | d <Ú |  | | | d | <Û d a d  S(   Ni   i   i   i   i   (   s   IntParI1s   IntLocs   IntParI2s	   Array1Pars   ranges   IntIndexs	   Array2Pars   IntGlob(   s	   Array1Pars	   Array2Pars   IntParI1s   IntParI2s   IntLocs   IntIndex(    (    s"   /usr/lib/python2.2/test/pystone.pys   Proc8Ğ s    	%c    s;   İ Ş |  } ß | } à | | j o á t Sn ã t Sd  S(   N(   s   CharPar1s   CharLoc1s   CharLoc2s   CharPar2s   Ident1s   Ident2(   s   CharPar1s   CharPar2s   CharLoc2s   CharLoc1(    (    s"   /usr/lib/python2.2/test/pystone.pys   Func1İ s
   		c    sŞ   å æ d } ç xT ç | d j oC è t |  | | | d ƒ t j o é d } ê | d } n q Wë | d j o
 | d j o ì d } n í | d j o î t Sn0 ğ |  | j o ñ | d } ò t Sn ô t Sd  S(   Ni   s   As   Ws   Zi   s   X(   s   IntLocs   Func1s   StrParI1s   StrParI2s   Ident1s   CharLocs   TRUEs   FALSE(   s   StrParI1s   StrParI2s   CharLocs   IntLoc(    (    s"   /usr/lib/python2.2/test/pystone.pys   Func2å s   	 %	c    s2   ö ÷ |  } ø | t j o ø t Sn ù t Sd  S(   N(   s	   EnumParIns   EnumLocs   Ident3s   TRUEs   FALSE(   s	   EnumParIns   EnumLoc(    (    s"   /usr/lib/python2.2/test/pystone.pys   Func3ö s   	 s   __main__N('   s   __doc__s   LOOPSs   times   clocks   __version__s   ranges   Ident1s   Ident2s   Ident3s   Ident4s   Ident5s   Records   TRUEs   FALSEs   mains   pystoness   IntGlobs   BoolGlobs	   Char1Globs	   Char2Globs
   Array1Globs   maps
   Array2Globs   Nones   PtrGlbs
   PtrGlbNexts   Proc0s   Proc1s   Proc2s   Proc3s   Proc4s   Proc5s   Proc6s   Proc7s   Proc8s   Func1s   Func2s   Func3s   __name__(   s   pystoness   Proc6s   Func2s   Proc5s   Records   TRUEs   __version__s   Ident4s   Ident5s   Func1s   FALSEs   Ident1s   Ident2s   Ident3s   clocks   Func3s   Proc8s   LOOPSs   Proc4s   Proc7s   mains   Proc1s   Proc0s   Proc3s   Proc2(    (    s"   /usr/lib/python2.2/test/pystone.pys   ?! s>   		!								6
