ó dØê[c@sçdZdZddlmZdZeddƒ\ZZZZ Z dd d„ƒYZ dZ d Z ed „Zed „Zd ae ad ad ad gd aed„tgd ƒadadaed„Zd„Zd„Zd„Zd„Zd„Zd„Z d„Z!d„Z"d„Z#d„Z$d„Z%e&dkrãddl'Z'd„Z(e)e'j*ƒdZ+e+dkre(de+ƒnUe+dkrÐye,e'j*dƒZ-WqÖe.k rÌe(de'j*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Ãiÿÿÿÿ(tclocks1.1iitRecordcBs)eZdddddd„Zd„ZRS(icCs1||_||_||_||_||_dS(N(tPtrComptDiscrtEnumComptIntCompt StringComp(tselfRRRRR((s"/usr/lib/python2.7/test/pystone.pyt__init__-s     cCs%t|j|j|j|j|jƒS(N(RRRRRR(R((s"/usr/lib/python2.7/test/pystone.pytcopy5sN(t__name__t __module__tNoneRR (((s"/usr/lib/python2.7/test/pystone.pyR+s icCs1t|ƒ\}}dt||fGHd|GHdS(Ns#Pystone(%s) time for %d passes = %gs-This machine benchmarks at %g pystones/second(tpystonest __version__(tloopst benchtimetstones((s"/usr/lib/python2.7/test/pystone.pytmain<scCs t|ƒS(N(tProc0(R((s"/usr/lib/python2.7/test/pystone.pyR Csti3cCs|S(N((tx((s"/usr/lib/python2.7/test/pystone.pytKsc Csîtƒ}xt|ƒD]}qWtƒ|}tƒatƒatt_tt_tt_ dt_ dt_ d}dt dd!sT    :