Back to index

python3.2  3.2.2
Classes | Functions | Variables
test.pystone Namespace Reference

Classes

class  Record

Functions

def main
def pystones
def Proc0
def Proc1
def Proc2
def Proc3
def Proc4
def Proc5
def Proc6
def Proc7
def Proc8
def Func1
def Func2
def Func3
def error

Variables

int LOOPS = 50000
string __version__ = "1.1"
int TRUE = 1
int FALSE = 0
int IntGlob = 0
 BoolGlob = FALSE
string Char1Glob = '\0'
string Char2Glob = '\0'
list Array1Glob = [0]
list Array2Glob = [x[:] for x in [Array1Glob]*51]
 PtrGlb = None
 PtrGlbNext = None
tuple nargs = len(sys.argv)
 loops = LOOPS

Function Documentation

def test.pystone.error (   msg)

Definition at line 257 of file pystone.py.

00257 
00258     def error(msg):
00259         print(msg, end=' ', file=sys.stderr)
00260         print("usage: %s [number_of_loops]" % sys.argv[0], file=sys.stderr)
        sys.exit(100)
def test.pystone.Func1 (   CharPar1,
  CharPar2 
)

Definition at line 225 of file pystone.py.

00225 
00226 def Func1(CharPar1, CharPar2):
00227     CharLoc1 = CharPar1
00228     CharLoc2 = CharLoc1
00229     if CharLoc2 != CharPar2:
00230         return Ident1
00231     else:
00232         return Ident2

Here is the caller graph for this function:

def test.pystone.Func2 (   StrParI1,
  StrParI2 
)

Definition at line 233 of file pystone.py.

00233 
00234 def Func2(StrParI1, StrParI2):
00235     IntLoc = 1
00236     while IntLoc <= 1:
00237         if Func1(StrParI1[IntLoc], StrParI2[IntLoc+1]) == Ident1:
00238             CharLoc = 'A'
00239             IntLoc = IntLoc + 1
00240     if CharLoc >= 'W' and CharLoc <= 'Z':
00241         IntLoc = 7
00242     if CharLoc == 'X':
00243         return TRUE
00244     else:
00245         if StrParI1 > StrParI2:
00246             IntLoc = IntLoc + 7
00247             return TRUE
00248         else:
00249             return FALSE

Here is the call graph for this function:

Here is the caller graph for this function:

def test.pystone.Func3 (   EnumParIn)

Definition at line 250 of file pystone.py.

00250 
00251 def Func3(EnumParIn):
00252     EnumLoc = EnumParIn
00253     if EnumLoc == Ident3: return TRUE
00254     return FALSE

Here is the caller graph for this function:

def test.pystone.main (   loops = LOOPS)

Definition at line 60 of file pystone.py.

00060 
00061 def main(loops=LOOPS):
00062     benchtime, stones = pystones(loops)
00063     print("Pystone(%s) time for %d passes = %g" % \
00064           (__version__, loops, benchtime))
00065     print("This machine benchmarks at %g pystones/second" % stones)
00066 

Here is the call graph for this function:

def test.pystone.Proc0 (   loops = LOOPS)

Definition at line 79 of file pystone.py.

00079 
00080 def Proc0(loops=LOOPS):
00081     global IntGlob
00082     global BoolGlob
00083     global Char1Glob
00084     global Char2Glob
00085     global Array1Glob
00086     global Array2Glob
00087     global PtrGlb
00088     global PtrGlbNext
00089 
00090     starttime = clock()
00091     for i in range(loops):
00092         pass
00093     nulltime = clock() - starttime
00094 
00095     PtrGlbNext = Record()
00096     PtrGlb = Record()
00097     PtrGlb.PtrComp = PtrGlbNext
00098     PtrGlb.Discr = Ident1
00099     PtrGlb.EnumComp = Ident3
00100     PtrGlb.IntComp = 40
00101     PtrGlb.StringComp = "DHRYSTONE PROGRAM, SOME STRING"
00102     String1Loc = "DHRYSTONE PROGRAM, 1'ST STRING"
00103     Array2Glob[8][7] = 10
00104 
00105     starttime = clock()
00106 
00107     for i in range(loops):
00108         Proc5()
00109         Proc4()
00110         IntLoc1 = 2
00111         IntLoc2 = 3
00112         String2Loc = "DHRYSTONE PROGRAM, 2'ND STRING"
00113         EnumLoc = Ident2
00114         BoolGlob = not Func2(String1Loc, String2Loc)
00115         while IntLoc1 < IntLoc2:
00116             IntLoc3 = 5 * IntLoc1 - IntLoc2
00117             IntLoc3 = Proc7(IntLoc1, IntLoc2)
00118             IntLoc1 = IntLoc1 + 1
00119         Proc8(Array1Glob, Array2Glob, IntLoc1, IntLoc3)
00120         PtrGlb = Proc1(PtrGlb)
00121         CharIndex = 'A'
00122         while CharIndex <= Char2Glob:
00123             if EnumLoc == Func1(CharIndex, 'C'):
00124                 EnumLoc = Proc6(Ident1)
00125             CharIndex = chr(ord(CharIndex)+1)
00126         IntLoc3 = IntLoc2 * IntLoc1
00127         IntLoc2 = IntLoc3 / IntLoc1
00128         IntLoc2 = 7 * (IntLoc3 - IntLoc2) - IntLoc1
00129         IntLoc1 = Proc2(IntLoc1)
00130 
00131     benchtime = clock() - starttime - nulltime
00132     if benchtime == 0.0:
00133         loopsPerBenchtime = 0.0
00134     else:
00135         loopsPerBenchtime = (loops / benchtime)
00136     return benchtime, loopsPerBenchtime

Here is the call graph for this function:

Here is the caller graph for this function:

def test.pystone.Proc1 (   PtrParIn)

Definition at line 137 of file pystone.py.

00137 
00138 def Proc1(PtrParIn):
00139     PtrParIn.PtrComp = NextRecord = PtrGlb.copy()
00140     PtrParIn.IntComp = 5
00141     NextRecord.IntComp = PtrParIn.IntComp
00142     NextRecord.PtrComp = PtrParIn.PtrComp
00143     NextRecord.PtrComp = Proc3(NextRecord.PtrComp)
00144     if NextRecord.Discr == Ident1:
00145         NextRecord.IntComp = 6
00146         NextRecord.EnumComp = Proc6(PtrParIn.EnumComp)
00147         NextRecord.PtrComp = PtrGlb.PtrComp
00148         NextRecord.IntComp = Proc7(NextRecord.IntComp, 10)
00149     else:
00150         PtrParIn = NextRecord.copy()
00151     NextRecord.PtrComp = None
00152     return PtrParIn

Here is the call graph for this function:

Here is the caller graph for this function:

def test.pystone.Proc2 (   IntParIO)

Definition at line 153 of file pystone.py.

00153 
00154 def Proc2(IntParIO):
00155     IntLoc = IntParIO + 10
00156     while 1:
00157         if Char1Glob == 'A':
00158             IntLoc = IntLoc - 1
00159             IntParIO = IntLoc - IntGlob
00160             EnumLoc = Ident1
00161         if EnumLoc == Ident1:
00162             break
00163     return IntParIO

Here is the caller graph for this function:

def test.pystone.Proc3 (   PtrParOut)

Definition at line 164 of file pystone.py.

00164 
00165 def Proc3(PtrParOut):
00166     global IntGlob
00167 
00168     if PtrGlb is not None:
00169         PtrParOut = PtrGlb.PtrComp
00170     else:
00171         IntGlob = 100
00172     PtrGlb.IntComp = Proc7(10, IntGlob)
00173     return PtrParOut

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 174 of file pystone.py.

00174 
00175 def Proc4():
00176     global Char2Glob
00177 
00178     BoolLoc = Char1Glob == 'A'
00179     BoolLoc = BoolLoc or BoolGlob
00180     Char2Glob = 'B'

Here is the caller graph for this function:

Definition at line 181 of file pystone.py.

00181 
00182 def Proc5():
00183     global Char1Glob
00184     global BoolGlob
00185 
00186     Char1Glob = 'A'
00187     BoolGlob = FALSE

Here is the caller graph for this function:

def test.pystone.Proc6 (   EnumParIn)

Definition at line 188 of file pystone.py.

00188 
00189 def Proc6(EnumParIn):
00190     EnumParOut = EnumParIn
00191     if not Func3(EnumParIn):
00192         EnumParOut = Ident4
00193     if EnumParIn == Ident1:
00194         EnumParOut = Ident1
00195     elif EnumParIn == Ident2:
00196         if IntGlob > 100:
00197             EnumParOut = Ident1
00198         else:
00199             EnumParOut = Ident4
00200     elif EnumParIn == Ident3:
00201         EnumParOut = Ident2
00202     elif EnumParIn == Ident4:
00203         pass
00204     elif EnumParIn == Ident5:
00205         EnumParOut = Ident3
00206     return EnumParOut

Here is the call graph for this function:

Here is the caller graph for this function:

def test.pystone.Proc7 (   IntParI1,
  IntParI2 
)

Definition at line 207 of file pystone.py.

00207 
00208 def Proc7(IntParI1, IntParI2):
00209     IntLoc = IntParI1 + 2
00210     IntParOut = IntParI2 + IntLoc
00211     return IntParOut

Here is the caller graph for this function:

def test.pystone.Proc8 (   Array1Par,
  Array2Par,
  IntParI1,
  IntParI2 
)

Definition at line 212 of file pystone.py.

00212 
00213 def Proc8(Array1Par, Array2Par, IntParI1, IntParI2):
00214     global IntGlob
00215 
00216     IntLoc = IntParI1 + 5
00217     Array1Par[IntLoc] = IntParI2
00218     Array1Par[IntLoc+1] = Array1Par[IntLoc]
00219     Array1Par[IntLoc+30] = IntLoc
00220     for IntIndex in range(IntLoc, IntLoc+2):
00221         Array2Par[IntLoc][IntIndex] = IntLoc
00222     Array2Par[IntLoc][IntLoc-1] = Array2Par[IntLoc][IntLoc-1] + 1
00223     Array2Par[IntLoc+20][IntLoc] = Array1Par[IntLoc]
00224     IntGlob = 5

Here is the caller graph for this function:

def test.pystone.pystones (   loops = LOOPS)

Definition at line 67 of file pystone.py.

00067 
00068 def pystones(loops=LOOPS):
00069     return Proc0(loops)

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

Definition at line 39 of file pystone.py.

Definition at line 74 of file pystone.py.

list test.pystone.Array2Glob = [x[:] for x in [Array1Glob]*51]

Definition at line 75 of file pystone.py.

Definition at line 71 of file pystone.py.

Definition at line 72 of file pystone.py.

Definition at line 73 of file pystone.py.

Definition at line 58 of file pystone.py.

Definition at line 70 of file pystone.py.

Definition at line 35 of file pystone.py.

Definition at line 269 of file pystone.py.

Definition at line 261 of file pystone.py.

Definition at line 76 of file pystone.py.

Definition at line 77 of file pystone.py.

Definition at line 57 of file pystone.py.