mς %U²Ic@sιdZdZdklZdZeddƒ\ZZZZ Z dfd„ƒYZ dZ dZ ed „Zed „Zdae ad ad adgd aed „tgd ƒadadaed„Zd„Zd„Zd„Zd„Zd„Zd„Z d„Z!d„Z"d„Z#d„Z$d„Z%e&djo«dk'Z'd„Z(e)e'i*ƒdZ+e+djoe(de+ƒnZe+djoFye,e'i*dƒZ-WqΧe.j oe(de'i*dƒqΧXneZ-ee-ƒndS(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. iPΓ(sclocks1.1iitRecordcBs)tZdddddd„Zd„ZRS(NicCs1||_||_||_||_||_dS(N(tPtrComptselftDiscrtEnumComptIntCompt StringComp(RRRRRR((t)/data/zmath/lib/python2.4/test/pystone.pyt__init__-s     cCs%t|i|i|i|i|iƒS(N(RRRRRRR(R((Rtcopy5s(t__name__t __module__tNoneRR (((RR+sicCs1t|ƒ\}}dt||fGHd|GHdS(Ns#Pystone(%s) time for %d passes = %gs-This machine benchmarks at %g pystones/second(tpystonestloopst benchtimetstonest __version__(RRR((Rtmain<scCs t|ƒS(N(tProc0R(R((RR Csti3cCs|S(N(tx(R((RtKsc CsΩtƒ} xt|ƒD]} qWtƒ| }tƒatƒatt_ t t_ t t_ dt_dt_d}dtddtBoolLocR,R3(RB((RR%ͺs  cCsdatadS(NR(R>tFALSER,(((RR$±scCs₯|}t|ƒp t}n|tjo t}nn|tjo!tdjo t}q‘t}n@|tjo t}n)|tjon|tjo t}n|S(Nid( t EnumParInt EnumParOuttFunc3tIdent4R R)R?R!tIdent5(RDRE((RR5Έs              cCs|d}||}|S(Ni(tIntParI1R=tIntParI2t IntParOut(RIRJRKR=((RR.Λs  cCs’|d}|||<||||d<|||dR3R0tmapR#R RRRR1R8R;R%R$R5R.R/R4R+RFR R[R`tlenR^tnargstintRt ValueError(RRYRFR+R4RRbRR/R RfR[RRGRHRRCR R)R!R`R$R%R.R5R1RR;R8((Rt?!sT     6