MCPcopy Index your code
hub / github.com/RustPython/RustPython / Proc0

Function Proc0

benches/benchmarks/pystone.py:77–133  ·  view source on GitHub ↗
(loops)

Source from the content-addressed store, hash-verified

75PtrGlbNext = None
76
77def Proc0(loops):
78 global IntGlob
79 global BoolGlob
80 global Char1Glob
81 global Char2Glob
82 global Array1Glob
83 global Array2Glob
84 global PtrGlb
85 global PtrGlbNext
86
87 starttime = clock()
88 for i in range(loops):
89 pass
90 nulltime = clock() - starttime
91
92 PtrGlbNext = Record()
93 PtrGlb = Record()
94 PtrGlb.PtrComp = PtrGlbNext
95 PtrGlb.Discr = Ident1
96 PtrGlb.EnumComp = Ident3
97 PtrGlb.IntComp = 40
98 PtrGlb.StringComp = "DHRYSTONE PROGRAM, SOME STRING"
99 String1Loc = "DHRYSTONE PROGRAM, 1'ST STRING"
100 Array2Glob[8][7] = 10
101
102 starttime = clock()
103
104 for i in range(loops):
105 Proc5()
106 Proc4()
107 IntLoc1 = 2
108 IntLoc2 = 3
109 String2Loc = "DHRYSTONE PROGRAM, 2'ND STRING"
110 EnumLoc = Ident2
111 BoolGlob = not Func2(String1Loc, String2Loc)
112 while IntLoc1 < IntLoc2:
113 IntLoc3 = 5 * IntLoc1 - IntLoc2
114 IntLoc3 = Proc7(IntLoc1, IntLoc2)
115 IntLoc1 = IntLoc1 + 1
116 Proc8(Array1Glob, Array2Glob, IntLoc1, IntLoc3)
117 PtrGlb = Proc1(PtrGlb)
118 CharIndex = 'A'
119 while CharIndex <= Char2Glob:
120 if EnumLoc == Func1(CharIndex, 'C'):
121 EnumLoc = Proc6(Ident1)
122 CharIndex = chr(ord(CharIndex)+1)
123 IntLoc3 = IntLoc2 * IntLoc1
124 IntLoc2 = IntLoc3 / IntLoc1
125 IntLoc2 = 7 * (IntLoc3 - IntLoc2) - IntLoc1
126 IntLoc1 = Proc2(IntLoc1)
127
128 benchtime = clock() - starttime - nulltime
129 if benchtime == 0.0:
130 loopsPerBenchtime = 0.0
131 else:
132 loopsPerBenchtime = (loops / benchtime)
133 return benchtime, loopsPerBenchtime
134

Callers 1

pystone.pyFile · 0.85

Calls 12

RecordClass · 0.85
Proc5Function · 0.85
Proc4Function · 0.85
Func2Function · 0.85
Proc7Function · 0.85
Proc8Function · 0.85
Proc1Function · 0.85
Func1Function · 0.85
Proc6Function · 0.85
chrFunction · 0.85
ordFunction · 0.85
Proc2Function · 0.85

Tested by

no test coverage detected