/snap/core18/2979/usr/lib/python3.6/test/__pycache__
NameSizeModeActions
pystone.cpython-36.pyc69300644editdlrm
regrtest.cpython-36.pyc7520644editdlrm
test_support.cpython-36.pyc185610644editdlrm
__init__.cpython-36.pyc1180644editdlrm
__main__.cpython-36.pyc1710644editdlrm
Edit: /snap/core18/2979/usr/lib/python3.6/test/__pycache__/pystone.cpython-36.pyc (6930B)
3 Nqi1 @sdZdZddlmZdZedd\ZZZZZ GdddZ dZ dZ efd d Z efd d Zdae ad ad adgdaddtgdDadadaefddZddZddZddZddZddZddZd d!Zd"d#Zd$d%Z d&d'Z!d(d)Z"e#d*krddl$Z$d+d,Z%e&e$j'dZ(e(dkr4e%d-e(nLe(dkr|ye)e$j'dZ*Wn(e+k rxe%d.e$j'dYnXneZ*e e*dS)/aD "PYSTONE" Benchmark Program Version: Python/1.2 (corresponds to C/1.1 plus 3 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. Version 1.2 changes the division to floor division. Under Python 3 version 1.1 would use the normal division operator, resulting in some of the operations mistakenly yielding floats. Version 1.2 instead uses floor division making the benchmark an integer benchmark again. iP)timez1.2c@seZdZdddZddZdS)RecordNrcCs"||_||_||_||_||_dS)N)PtrCompDiscrEnumCompIntComp StringComp)selfrrrr r r "/usr/lib/python3.6/test/pystone.py__init__4s zRecord.__init__cCst|j|j|j|j|jS)N)rrrrr r )r r r r copy<sz Record.copy)Nrrrr)__name__ __module__ __qualname__rrr r r r r2s rcCs.t|\}}tdt||ftd|dS)Nz#Pystone(%s) time for %d passes = %gz-This machine benchmarks at %g pystones/second)pystonesprint __version__)loops benchtimeZstonesr r r mainCs rcCst|S)N)Proc0)rr r r rJsr3cCsg|]}|ddqS)Nr ).0xr r r RsrNc Cspt}xt|D]}qWt|}tatatt_tt_tt_ dt_ dt_ d}dt dd<t}xt|D]}t td}d}d }t}t|| ax*||krd ||} t||} |d }qWttt || ttad } x6| tkr|t| d krtt}tt| d } qW||} | |}d| ||}t|}qlWt||} | dkr`d} n|| } | | fS)N(zDHRYSTONE PROGRAM, SOME STRINGzDHRYSTONE PROGRAM, 1'ST STRING zDHRYSTONE PROGRAM, 2'ND STRINGrACg)rranger PtrGlbNextPtrGlbrIdent1rIdent3rr r Array2GlobProc5Proc4Ident2Func2BoolGlobProc7Proc8 Array1GlobProc1 Char2GlobFunc1Proc6chrordProc2) rZ starttimeiZnulltimeZ String1LocZIntLoc1ZIntLoc2Z String2LocEnumLocZIntLoc3Z CharIndexrZloopsPerBenchtimer r r rVsT           rcCsvtj|_}d|_|j|_|j|_t|j|_|jtkrdd|_t|j|_tj|_t |jd|_n|j}d|_|S)Nr%rr ) r*rrr Proc3rr+r9rr3)ZPtrParInZ NextRecordr r r r6s   r6cCs8|d}x*tdkr&|d}|t}t}|tkr Pq W|S)Nr r&r) Char1GlobIntGlobr+)ZIntParIOIntLocr>r r r r<sr<cCs$tdk rtj}ndatdtt_|S)Ndr )r*rrAr3r )Z PtrParOutr r r r?s  r?cCstdk}|pt}dadS)Nr&B)r@r2r7)ZBoolLocr r r r/sr/cCs datadS)Nr&)r@FALSEr2r r r r r.sr.cCsb|}t|st}|tkrt}n@|tkr:tdkr4t}q^t}n$|tkrHt}n|tkrRn |tkr^t}|S)NrC)Func3Ident4r+r0rAr,Ident5) EnumParInZ EnumParOutr r r r9s r9cCs|d}||}|S)Nr#r )IntParI1IntParI2rBZ IntParOutr r r r3sr3cCs|d}|||<||||d<|||d<x"t||dD]}||||<qr r r rFsrF__main__cCs6t|dtjdtdtjdtjdtjddS)N )endfilezusage: %s [number_of_loops]r)rUrC)rsysstderrargvexit)msgr r r errorsr[z%d arguments are too many;zInvalid argument %r;),__doc__ZLOOPSrrr(r+r0r,rGrHrrQrErrrAr2r@r7r5r-r*r)rr6r<r?r/r.r9r3r4r8r1rFrrVr[lenrXnargsintr ValueErrorr r r r (sT     :