
    9i                     0   S r SSKJr  SSKJr  SrSr\" SS5      u  rr	r
rr " S S	\5      rSrSr\4S
 jr\4S jrSq\qSqSqS/S-  q[.        /S-   V s/ s H  o SS PM	     sn qSqSq\4S jrS rS rS rS rS r S r!S r"S r#S r$S r%S r&\'S:X  aU  SSK(r(S r)\*" \(RV                  5      S-
  r,\,S:  a  \)" S\,-  5        O\,S:X  a  \-" \(RV                  S   5      r.O\r.\" \.5        ggs  sn f ! \/ a    \)" S\(RV                  S   -  5         N/f = f)a  
"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  z1.1      c                   (    \ rS rSr  SS jrS rSrg)Record-   Nc                 @    Xl         X l        X0l        X@l        XPl        g N)PtrCompDiscrEnumCompIntComp
StringComp)selfr   r   r   r   r   s         ]/var/www/html/land-doc-ocr/venv/lib/python3.13/site-packages/future/backports/test/pystone.py__init__Record.__init__/   s    
 $    c                     [        U R                  U R                  U R                  U R                  U R
                  5      $ r   )r   r   r   r   r   r   )r   s    r   copyRecord.copy7   s.    dllDJJllDOO5 	5r   )r   r   r   r   r   )Nr   r   r   r   )__name__
__module____qualname____firstlineno__r   r   __static_attributes__ r   r   r   r   -   s    =>12%5r   r   c                 b    [        U 5      u  p[        S[        X4-  5        [        SU-  5        g )Nz#Pystone(%s) time for %d passes = %gz-This machine benchmarks at %g pystones/second)pystonesprint__version__)loops	benchtimestoness      r   mainr&   >   s4     I	
/
)* +	
9F
BCr   c                     [        U 5      $ r   )Proc0)r#   s    r   r    r    E   s    <r    3   Nc                 b   [        5       n[        U 5       H  nM     [        5       U-
  n[        5       q[        5       q[        [        l        [        [        l        [        [        l	        S[        l
        S[        l        SnS[        S   S'   [        5       n[        U 5       H  n[        5         [        5         SnSnS	n[        n[!        XG5      (       + qXV:  a  S
U-  U-
  n	[%        XV5      n	US-   nXV:  a  M  ['        [(        [        UW	5        [+        [        5      qSn
U
[,        ::  aB  U[/        U
S5      :X  a  [1        [        5      n[3        [5        U
5      S-   5      n
U
[,        ::  a  MB  Xe-  n	X-  nSX-
  -  U-
  n[7        U5      nM     [        5       U-
  U-
  nUS:X  a  SnX4$ X-  nX4$ )N(   zDHRYSTONE PROGRAM, SOME STRINGzDHRYSTONE PROGRAM, 1'ST STRING
               zDHRYSTONE 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)r#   	starttimeinulltime
String1LocIntLoc1IntLoc2
String2LocEnumLocIntLoc3	CharIndexr$   loopsPerBenchtimes                r   r(   r(   Q   s    I5\ w"HJXFFNFLFOFN8F1JJqM!I5\5
Z44'kG+GG-GkG  	j*gw7v	9$%	3//-C	N1,-I 9$ ##w()G3.- 0 )#h.IC '' #.''r   c                    [         R                  5       =U l        nSU l        U R                  Ul        U R                  Ul        [	        UR                  5      Ul        UR
                  [        :X  aR  SUl        [        U R                  5      Ul        [         R                  Ul        [        UR                  S5      Ul        OUR                  5       n S Ul        U $ )Nr2   r   r-   )
r7   r   r   r   Proc3r   r8   rF   r   r@   )PtrParIn
NextRecords     r   rC   rC      s    $*KKM1HzH!))J!))Jz112J6!
#H$5$56
#^^
":#5#5r:
??$JOr   c                 h    U S-   n [         S:X  a  US-
  nU[        -
  n [        nW[        :X  a   U $ M-  )Nr-   r   r3   )	Char1GlobIntGlobr8   )IntParIOIntLocrQ   s      r   rI   rI      sC    ]F
aZF'HGfO r   c                 l    [         b  [         R                  n OSq[        S[        5      [         l        U $ )Nd   r-   )r7   r   r[   r@   r   )	PtrParOuts    r   rV   rV      s,     NN	2w'FNr   c                  8    [         S:H  n U =(       d    [        n Sqg )Nr3   B)rZ   r?   rD   )BoolLocs    r   r<   r<      s     3G!GIr   c                      Sq [        qg )Nr3   )rZ   FALSEr?   r   r   r   r;   r;      s     IHr   c                    U n[        U 5      (       d  [        nU [        :X  a  [        nU$ U [        :X  a  [        S:  a  [        nU$ [        n U$ U [
        :X  a  [        nU$ U [        :X  a   U$ U [        :X  a  [
        nU$ )Nr_   )Func3Ident4r8   r=   r[   r9   Ident5)	EnumParIn
EnumParOuts     r   rF   rF      s    J
F
  
f	S=J   J  
f	

 	 
f	  
f	
r   c                     U S-   nX-   nU$ )Nr0   r   )IntParI1IntParI2r]   	IntParOuts       r   r@   r@      s    \F!Ir   c                     US-   nX0U'   X   XS-   '   X@US-   '   [        XDS-   5       H
  nXAU   U'   M     X   US-
     S-   X   US-
  '   X   XS-      U'   Sqg )Nr2   r      r0      )r5   r[   )	Array1Par	Array2Parrm   rn   r]   IntIndexs         r   rA   rA      s     \F f#+IQh!fRi&(+&,&(# ,"+"3F1H"="AIfQh#,#4IRi Gr   c                 ,    U nUnX1:w  a  [         $ [        $ r   )r8   r=   )CharPar1CharPar2CharLoc1CharLoc2s       r   rE   rE      s    HHr   c                     SnUS::  a*  [        X   XS-      5      [        :X  a  SnUS-   nUS::  a  M*  WS:  a  US::  a  SnUS:X  a  [        $ X:  a  US-   n[        $ [        $ )Nr   r3   WZr/   X)rE   r8   TRUEre   )StrParI1StrParI2r]   CharLocs       r   r>   r>      sw    F
A+!81H#56&@GaZF A+ #~'S.#~aZFKLr   c                 2    U nU[         :X  a  [        $ [        $ r   )r9   r   re   )rj   rQ   s     r   rg   rg      s    G&+Lr   __main__c                     [        U S[        R                  S9  [        S[        R                  S   -  [        R                  S9  [        R                  " S5        g )N )endfilezusage: %s [number_of_loops]r   )r   r_   )r!   sysstderrargvexit)msgs    r   errorr     s9    cs,+chhqk9

Kr   z%d arguments are too many;zInvalid argument %r;)0__doc__
__future__r   timer   LOOPSr"   r5   r8   r=   r9   rh   ri   objectr   r   re   r&   r    r[   r?   rZ   rD   rB   r:   r7   r6   r(   rC   rI   rV   r<   r;   rF   r@   rA   rE   r>   rg   r   r   r   lenr   nargsintr#   
ValueError)xs   0r   <module>r      sz  @ & +0A; (5V 5 		 D   		SV
'LO,OqdO,
	
 8(t 	&
"
 z MAEqy*U23	!!%U K i -~  	8(388A;67	8s   C/C4 4DD