Hacked By AnonymousFox

Current Path : /opt/alt/python37/lib/python3.7/site-packages/future/backports/test/__pycache__/
Upload File :
Current File : //opt/alt/python37/lib/python3.7/site-packages/future/backports/test/__pycache__/pystone.cpython-37.pyc

B

�A�[�@s�dZddlmZddlmZdZdZedd�\ZZ	Z
ZZGdd	�d	e
�ZdZdZefd
d�Zefdd
�Zdaeadadadgdadd�tgdD�adadaefdd�Zdd�Zdd�Zdd�Zdd�Zdd�Z dd �Z!d!d"�Z"d#d$�Z#d%d&�Z$d'd(�Z%d)d*�Z&e'd+k�r�ddl(Z(d,d-�Z)e*e(j+�dZ,e,dk�rBe)d.e,�nLe,dk�r�ye-e(j+d�Z.Wn(e/k
�r�e)d/e(j+d�YnXneZ.ee.�dS)0a�
"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.

�)�print_function)�clockiP�z1.1��c@seZdZddd�Zdd�ZdS)�RecordNrcCs"||_||_||_||_||_dS)N)�PtrComp�Discr�EnumComp�IntComp�
StringComp)�selfrrr	r
r�r
�N/opt/alt/python37/lib/python3.7/site-packages/future/backports/test/pystone.py�__init__/s
zRecord.__init__cCst|j|j|j|j|j�S)N)rrrr	r
r)rr
r
r�copy7szRecord.copy)Nrrrr)�__name__�
__module__�__qualname__rrr
r
r
rr-s
rcCs.t|�\}}tdt||f�td|�dS)Nz#Pystone(%s) time for %d passes = %gz-This machine benchmarks at %g pystones/second)�pystones�print�__version__)�loops�	benchtimeZstonesr
r
r�main>srcCst|�S)N)�Proc0)rr
r
rrEsr��3cCsg|]}|dd��qS)Nr
)�.0�xr
r
r�
<listcomp>MsrNc
Cspt�}xt|�D]}qWt�|}t�at�att_tt_tt_	dt_
dt_d}dtdd<t�}x�t|�D]�}t
�t�d}d}d	}t}t||�ax*||kr�d
||}	t||�}	|d}q�Wttt||	�tt�ad}
x6|
tk�r|t|
d
�k�rtt�}tt|
�d�}
q�W||}	|	|}d|	||}t|�}qlWt�||}|dk�r`d}n||}||fS)N�(zDHRYSTONE PROGRAM, SOME STRINGzDHRYSTONE PROGRAM, 1'ST STRING�
����zDHRYSTONE PROGRAM, 2'ND STRING�r�A�Cg)r�ranger�
PtrGlbNext�PtrGlbr�Ident1r�Ident3r	r
r�
Array2Glob�Proc5�Proc4�Ident2�Func2�BoolGlob�Proc7�Proc8�
Array1Glob�Proc1�	Char2Glob�Func1�Proc6�chr�ord�Proc2)
rZ	starttime�iZnulltimeZ
String1LocZIntLoc1ZIntLoc2Z
String2Loc�EnumLocZIntLoc3Z	CharIndexrZloopsPerBenchtimer
r
rrQsT




rcCsvt��|_}d|_|j|_|j|_t|j�|_|jtkrdd|_t|j�|_tj|_t	|jd�|_n|��}d|_|S)Nr&rr!)
r+rrr
�Proc3rr,r:r	r4)ZPtrParInZ
NextRecordr
r
rr7�s
r7cCs8|d}x*tdkr&|d}|t}t}|tkr
Pq
W|S)Nr!r'r)�	Char1Glob�IntGlobr,)ZIntParIO�IntLocr?r
r
rr=�sr=cCs$tdk	rtj}ndatdt�t_|S)N�dr!)r+rrBr4r
)Z	PtrParOutr
r
rr@�s
r@cCstdk}|pt}dadS)Nr'�B)rAr3r8)ZBoolLocr
r
rr0�sr0cCsdatadS)Nr')rA�FALSEr3r
r
r
rr/�sr/cCsb|}t|�st}|tkrt}n@|tkr:tdkr4t}q^t}n$|tkrHt}n|tkrRn|tkr^t}|S)NrD)�Func3�Ident4r,r1rBr-�Ident5)�	EnumParInZ
EnumParOutr
r
rr:�s r:cCs|d}||}|S)Nr$r
)�IntParI1�IntParI2rCZ	IntParOutr
r
rr4�sr4cCs�|d}|||<||||d<|||d<x"t||d�D]}||||<q<W|||dd|||d<||||d|<dadS)Nr&r�r$�)r)rB)Z	Array1ParZ	Array2ParrKrLrCZIntIndexr
r
rr5�s r5cCs|}|}||krtStSdS)N)r,r1)ZCharPar1ZCharPar2ZCharLoc1ZCharLoc2r
r
rr9�s
r9cCstd}x2|dkr6t||||d�tkrd}|d}qW|dkrL|dkrLd}|dkrXtS||krl|d}tStSdS)Nrr'�W�Zr#�X)r9r,�TRUErF)ZStrParI1ZStrParI2rCZCharLocr
r
rr2�s
r2cCs|}|tkrtStS)N)r-rRrF)rJr?r
r
rrG�srG�__main__cCs6t|dtjd�tdtjdtjd�t�d�dS)N� )�end�filezusage: %s [number_of_loops]r)rVrD)r�sys�stderr�argv�exit)�msgr
r
r�errorsr\z%d arguments are too many;zInvalid argument %r;)0�__doc__�
__future__r�timerZLOOPSrr)r,r1r-rHrI�objectrrRrFrrrBr3rAr8r6r.r+r*rr7r=r@r0r/r:r4r5r9r2rGrrWr\�lenrY�nargs�intr�
ValueErrorr
r
r
r�<module>!sV
:






Hacked By AnonymousFox1.0, Coded By AnonymousFox