annotate Lib/test/pystone.py @ 79675:c0a2294de787 2.7

Issue #16199: Backport 2to3 typo fix from 3.2.
author Chris Jerdonek <chris.jerdonek@gmail.com>
date Thu, 11 Oct 2012 16:15:46 -0700
parents 49be8812d433
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
4573
73758db2f464 /usr/local/bin/python -> /usr/bin/env python
Guido van Rossum <guido@python.org>
parents: 2613
diff changeset
1 #! /usr/bin/env python
2613
b368be7b062a added "pystone" benchmark
Guido van Rossum <guido@python.org>
parents:
diff changeset
2
b368be7b062a added "pystone" benchmark
Guido van Rossum <guido@python.org>
parents:
diff changeset
3 """
b368be7b062a added "pystone" benchmark
Guido van Rossum <guido@python.org>
parents:
diff changeset
4 "PYSTONE" Benchmark Program
b368be7b062a added "pystone" benchmark
Guido van Rossum <guido@python.org>
parents:
diff changeset
5
15305
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
6 Version: Python/1.1 (corresponds to C/1.1 plus 2 Pystone fixes)
2613
b368be7b062a added "pystone" benchmark
Guido van Rossum <guido@python.org>
parents:
diff changeset
7
15305
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
8 Author: Reinhold P. Weicker, CACM Vol 27, No 10, 10/84 pg. 1013.
2613
b368be7b062a added "pystone" benchmark
Guido van Rossum <guido@python.org>
parents:
diff changeset
9
15305
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
10 Translated from ADA to C by Rick Richardson.
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
11 Every method to preserve ADA-likeness has been used,
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
12 at the expense of C-ness.
2613
b368be7b062a added "pystone" benchmark
Guido van Rossum <guido@python.org>
parents:
diff changeset
13
15305
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
14 Translated from C to Python by Guido van Rossum.
5001
17c7a133ccf7 Version 1.1. Fix memory leak and expensive comparison with None.
Guido van Rossum <guido@python.org>
parents: 4573
diff changeset
15
17c7a133ccf7 Version 1.1. Fix memory leak and expensive comparison with None.
Guido van Rossum <guido@python.org>
parents: 4573
diff changeset
16 Version History:
17c7a133ccf7 Version 1.1. Fix memory leak and expensive comparison with None.
Guido van Rossum <guido@python.org>
parents: 4573
diff changeset
17
15305
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
18 Version 1.1 corrects two bugs in version 1.0:
5001
17c7a133ccf7 Version 1.1. Fix memory leak and expensive comparison with None.
Guido van Rossum <guido@python.org>
parents: 4573
diff changeset
19
15305
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
20 First, it leaked memory: in Proc1(), NextRecord ends
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
21 up having a pointer to itself. I have corrected this
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
22 by zapping NextRecord.PtrComp at the end of Proc1().
5001
17c7a133ccf7 Version 1.1. Fix memory leak and expensive comparison with None.
Guido van Rossum <guido@python.org>
parents: 4573
diff changeset
23
15305
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
24 Second, Proc3() used the operator != to compare a
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
25 record to None. This is rather inefficient and not
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
26 true to the intention of the original benchmark (where
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
27 a pointer comparison to None is intended; the !=
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
28 operator attempts to find a method __cmp__ to do value
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
29 comparison of the record). Version 1.1 runs 5-10
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
30 percent faster than version 1.0, so benchmark figures
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
31 of different versions can't be compared directly.
5001
17c7a133ccf7 Version 1.1. Fix memory leak and expensive comparison with None.
Guido van Rossum <guido@python.org>
parents: 4573
diff changeset
32
2613
b368be7b062a added "pystone" benchmark
Guido van Rossum <guido@python.org>
parents:
diff changeset
33 """
b368be7b062a added "pystone" benchmark
Guido van Rossum <guido@python.org>
parents:
diff changeset
34
24604
2b0766afaa22 Bump the LOOPS count. 50,000 iterations takes about 5 seconds on my
Guido van Rossum <guido@python.org>
parents: 15305
diff changeset
35 LOOPS = 50000
2613
b368be7b062a added "pystone" benchmark
Guido van Rossum <guido@python.org>
parents:
diff changeset
36
b368be7b062a added "pystone" benchmark
Guido van Rossum <guido@python.org>
parents:
diff changeset
37 from time import clock
b368be7b062a added "pystone" benchmark
Guido van Rossum <guido@python.org>
parents:
diff changeset
38
5001
17c7a133ccf7 Version 1.1. Fix memory leak and expensive comparison with None.
Guido van Rossum <guido@python.org>
parents: 4573
diff changeset
39 __version__ = "1.1"
2613
b368be7b062a added "pystone" benchmark
Guido van Rossum <guido@python.org>
parents:
diff changeset
40
b368be7b062a added "pystone" benchmark
Guido van Rossum <guido@python.org>
parents:
diff changeset
41 [Ident1, Ident2, Ident3, Ident4, Ident5] = range(1, 6)
b368be7b062a added "pystone" benchmark
Guido van Rossum <guido@python.org>
parents:
diff changeset
42
b368be7b062a added "pystone" benchmark
Guido van Rossum <guido@python.org>
parents:
diff changeset
43 class Record:
b368be7b062a added "pystone" benchmark
Guido van Rossum <guido@python.org>
parents:
diff changeset
44
15305
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
45 def __init__(self, PtrComp = None, Discr = 0, EnumComp = 0,
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
46 IntComp = 0, StringComp = 0):
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
47 self.PtrComp = PtrComp
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
48 self.Discr = Discr
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
49 self.EnumComp = EnumComp
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
50 self.IntComp = IntComp
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
51 self.StringComp = StringComp
2613
b368be7b062a added "pystone" benchmark
Guido van Rossum <guido@python.org>
parents:
diff changeset
52
15305
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
53 def copy(self):
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
54 return Record(self.PtrComp, self.Discr, self.EnumComp,
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
55 self.IntComp, self.StringComp)
2613
b368be7b062a added "pystone" benchmark
Guido van Rossum <guido@python.org>
parents:
diff changeset
56
b368be7b062a added "pystone" benchmark
Guido van Rossum <guido@python.org>
parents:
diff changeset
57 TRUE = 1
b368be7b062a added "pystone" benchmark
Guido van Rossum <guido@python.org>
parents:
diff changeset
58 FALSE = 0
b368be7b062a added "pystone" benchmark
Guido van Rossum <guido@python.org>
parents:
diff changeset
59
31315
cd7b70a4c440 The script now takes an optional command-line argument to specify how many
Alex Martelli <aleaxit@gmail.com>
parents: 24604
diff changeset
60 def main(loops=LOOPS):
cd7b70a4c440 The script now takes an optional command-line argument to specify how many
Alex Martelli <aleaxit@gmail.com>
parents: 24604
diff changeset
61 benchtime, stones = pystones(loops)
15305
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
62 print "Pystone(%s) time for %d passes = %g" % \
31315
cd7b70a4c440 The script now takes an optional command-line argument to specify how many
Alex Martelli <aleaxit@gmail.com>
parents: 24604
diff changeset
63 (__version__, loops, benchtime)
15305
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
64 print "This machine benchmarks at %g pystones/second" % stones
6567
3fdd715e6ef9 Separate out a function pystones(loops=LOOPS) which runs the benchmark
Guido van Rossum <guido@python.org>
parents: 6031
diff changeset
65
3fdd715e6ef9 Separate out a function pystones(loops=LOOPS) which runs the benchmark
Guido van Rossum <guido@python.org>
parents: 6031
diff changeset
66
3fdd715e6ef9 Separate out a function pystones(loops=LOOPS) which runs the benchmark
Guido van Rossum <guido@python.org>
parents: 6031
diff changeset
67 def pystones(loops=LOOPS):
15305
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
68 return Proc0(loops)
2613
b368be7b062a added "pystone" benchmark
Guido van Rossum <guido@python.org>
parents:
diff changeset
69
b368be7b062a added "pystone" benchmark
Guido van Rossum <guido@python.org>
parents:
diff changeset
70 IntGlob = 0
b368be7b062a added "pystone" benchmark
Guido van Rossum <guido@python.org>
parents:
diff changeset
71 BoolGlob = FALSE
b368be7b062a added "pystone" benchmark
Guido van Rossum <guido@python.org>
parents:
diff changeset
72 Char1Glob = '\0'
b368be7b062a added "pystone" benchmark
Guido van Rossum <guido@python.org>
parents:
diff changeset
73 Char2Glob = '\0'
b368be7b062a added "pystone" benchmark
Guido van Rossum <guido@python.org>
parents:
diff changeset
74 Array1Glob = [0]*51
b368be7b062a added "pystone" benchmark
Guido van Rossum <guido@python.org>
parents:
diff changeset
75 Array2Glob = map(lambda x: x[:], [Array1Glob]*51)
b368be7b062a added "pystone" benchmark
Guido van Rossum <guido@python.org>
parents:
diff changeset
76 PtrGlb = None
b368be7b062a added "pystone" benchmark
Guido van Rossum <guido@python.org>
parents:
diff changeset
77 PtrGlbNext = None
b368be7b062a added "pystone" benchmark
Guido van Rossum <guido@python.org>
parents:
diff changeset
78
6567
3fdd715e6ef9 Separate out a function pystones(loops=LOOPS) which runs the benchmark
Guido van Rossum <guido@python.org>
parents: 6031
diff changeset
79 def Proc0(loops=LOOPS):
15305
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
80 global IntGlob
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
81 global BoolGlob
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
82 global Char1Glob
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
83 global Char2Glob
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
84 global Array1Glob
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
85 global Array2Glob
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
86 global PtrGlb
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
87 global PtrGlbNext
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
88
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
89 starttime = clock()
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
90 for i in range(loops):
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
91 pass
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
92 nulltime = clock() - starttime
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
93
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
94 PtrGlbNext = Record()
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
95 PtrGlb = Record()
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
96 PtrGlb.PtrComp = PtrGlbNext
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
97 PtrGlb.Discr = Ident1
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
98 PtrGlb.EnumComp = Ident3
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
99 PtrGlb.IntComp = 40
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
100 PtrGlb.StringComp = "DHRYSTONE PROGRAM, SOME STRING"
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
101 String1Loc = "DHRYSTONE PROGRAM, 1'ST STRING"
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
102 Array2Glob[8][7] = 10
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
103
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
104 starttime = clock()
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
105
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
106 for i in range(loops):
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
107 Proc5()
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
108 Proc4()
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
109 IntLoc1 = 2
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
110 IntLoc2 = 3
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
111 String2Loc = "DHRYSTONE PROGRAM, 2'ND STRING"
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
112 EnumLoc = Ident2
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
113 BoolGlob = not Func2(String1Loc, String2Loc)
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
114 while IntLoc1 < IntLoc2:
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
115 IntLoc3 = 5 * IntLoc1 - IntLoc2
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
116 IntLoc3 = Proc7(IntLoc1, IntLoc2)
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
117 IntLoc1 = IntLoc1 + 1
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
118 Proc8(Array1Glob, Array2Glob, IntLoc1, IntLoc3)
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
119 PtrGlb = Proc1(PtrGlb)
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
120 CharIndex = 'A'
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
121 while CharIndex <= Char2Glob:
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
122 if EnumLoc == Func1(CharIndex, 'C'):
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
123 EnumLoc = Proc6(Ident1)
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
124 CharIndex = chr(ord(CharIndex)+1)
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
125 IntLoc3 = IntLoc2 * IntLoc1
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
126 IntLoc2 = IntLoc3 / IntLoc1
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
127 IntLoc2 = 7 * (IntLoc3 - IntLoc2) - IntLoc1
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
128 IntLoc1 = Proc2(IntLoc1)
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
129
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
130 benchtime = clock() - starttime - nulltime
48027
49be8812d433 #3319: don't raise ZeroDivisionError if number of rounds is so
Georg Brandl <georg@python.org>
parents: 31389
diff changeset
131 if benchtime == 0.0:
49be8812d433 #3319: don't raise ZeroDivisionError if number of rounds is so
Georg Brandl <georg@python.org>
parents: 31389
diff changeset
132 loopsPerBenchtime = 0.0
49be8812d433 #3319: don't raise ZeroDivisionError if number of rounds is so
Georg Brandl <georg@python.org>
parents: 31389
diff changeset
133 else:
49be8812d433 #3319: don't raise ZeroDivisionError if number of rounds is so
Georg Brandl <georg@python.org>
parents: 31389
diff changeset
134 loopsPerBenchtime = (loops / benchtime)
49be8812d433 #3319: don't raise ZeroDivisionError if number of rounds is so
Georg Brandl <georg@python.org>
parents: 31389
diff changeset
135 return benchtime, loopsPerBenchtime
2613
b368be7b062a added "pystone" benchmark
Guido van Rossum <guido@python.org>
parents:
diff changeset
136
b368be7b062a added "pystone" benchmark
Guido van Rossum <guido@python.org>
parents:
diff changeset
137 def Proc1(PtrParIn):
15305
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
138 PtrParIn.PtrComp = NextRecord = PtrGlb.copy()
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
139 PtrParIn.IntComp = 5
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
140 NextRecord.IntComp = PtrParIn.IntComp
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
141 NextRecord.PtrComp = PtrParIn.PtrComp
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
142 NextRecord.PtrComp = Proc3(NextRecord.PtrComp)
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
143 if NextRecord.Discr == Ident1:
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
144 NextRecord.IntComp = 6
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
145 NextRecord.EnumComp = Proc6(PtrParIn.EnumComp)
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
146 NextRecord.PtrComp = PtrGlb.PtrComp
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
147 NextRecord.IntComp = Proc7(NextRecord.IntComp, 10)
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
148 else:
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
149 PtrParIn = NextRecord.copy()
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
150 NextRecord.PtrComp = None
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
151 return PtrParIn
2613
b368be7b062a added "pystone" benchmark
Guido van Rossum <guido@python.org>
parents:
diff changeset
152
b368be7b062a added "pystone" benchmark
Guido van Rossum <guido@python.org>
parents:
diff changeset
153 def Proc2(IntParIO):
15305
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
154 IntLoc = IntParIO + 10
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
155 while 1:
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
156 if Char1Glob == 'A':
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
157 IntLoc = IntLoc - 1
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
158 IntParIO = IntLoc - IntGlob
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
159 EnumLoc = Ident1
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
160 if EnumLoc == Ident1:
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
161 break
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
162 return IntParIO
2613
b368be7b062a added "pystone" benchmark
Guido van Rossum <guido@python.org>
parents:
diff changeset
163
b368be7b062a added "pystone" benchmark
Guido van Rossum <guido@python.org>
parents:
diff changeset
164 def Proc3(PtrParOut):
15305
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
165 global IntGlob
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
166
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
167 if PtrGlb is not None:
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
168 PtrParOut = PtrGlb.PtrComp
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
169 else:
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
170 IntGlob = 100
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
171 PtrGlb.IntComp = Proc7(10, IntGlob)
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
172 return PtrParOut
2613
b368be7b062a added "pystone" benchmark
Guido van Rossum <guido@python.org>
parents:
diff changeset
173
b368be7b062a added "pystone" benchmark
Guido van Rossum <guido@python.org>
parents:
diff changeset
174 def Proc4():
15305
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
175 global Char2Glob
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
176
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
177 BoolLoc = Char1Glob == 'A'
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
178 BoolLoc = BoolLoc or BoolGlob
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
179 Char2Glob = 'B'
2613
b368be7b062a added "pystone" benchmark
Guido van Rossum <guido@python.org>
parents:
diff changeset
180
b368be7b062a added "pystone" benchmark
Guido van Rossum <guido@python.org>
parents:
diff changeset
181 def Proc5():
15305
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
182 global Char1Glob
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
183 global BoolGlob
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
184
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
185 Char1Glob = 'A'
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
186 BoolGlob = FALSE
2613
b368be7b062a added "pystone" benchmark
Guido van Rossum <guido@python.org>
parents:
diff changeset
187
b368be7b062a added "pystone" benchmark
Guido van Rossum <guido@python.org>
parents:
diff changeset
188 def Proc6(EnumParIn):
15305
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
189 EnumParOut = EnumParIn
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
190 if not Func3(EnumParIn):
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
191 EnumParOut = Ident4
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
192 if EnumParIn == Ident1:
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
193 EnumParOut = Ident1
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
194 elif EnumParIn == Ident2:
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
195 if IntGlob > 100:
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
196 EnumParOut = Ident1
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
197 else:
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
198 EnumParOut = Ident4
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
199 elif EnumParIn == Ident3:
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
200 EnumParOut = Ident2
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
201 elif EnumParIn == Ident4:
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
202 pass
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
203 elif EnumParIn == Ident5:
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
204 EnumParOut = Ident3
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
205 return EnumParOut
2613
b368be7b062a added "pystone" benchmark
Guido van Rossum <guido@python.org>
parents:
diff changeset
206
b368be7b062a added "pystone" benchmark
Guido van Rossum <guido@python.org>
parents:
diff changeset
207 def Proc7(IntParI1, IntParI2):
15305
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
208 IntLoc = IntParI1 + 2
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
209 IntParOut = IntParI2 + IntLoc
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
210 return IntParOut
2613
b368be7b062a added "pystone" benchmark
Guido van Rossum <guido@python.org>
parents:
diff changeset
211
b368be7b062a added "pystone" benchmark
Guido van Rossum <guido@python.org>
parents:
diff changeset
212 def Proc8(Array1Par, Array2Par, IntParI1, IntParI2):
15305
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
213 global IntGlob
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
214
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
215 IntLoc = IntParI1 + 5
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
216 Array1Par[IntLoc] = IntParI2
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
217 Array1Par[IntLoc+1] = Array1Par[IntLoc]
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
218 Array1Par[IntLoc+30] = IntLoc
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
219 for IntIndex in range(IntLoc, IntLoc+2):
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
220 Array2Par[IntLoc][IntIndex] = IntLoc
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
221 Array2Par[IntLoc][IntLoc-1] = Array2Par[IntLoc][IntLoc-1] + 1
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
222 Array2Par[IntLoc+20][IntLoc] = Array1Par[IntLoc]
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
223 IntGlob = 5
2613
b368be7b062a added "pystone" benchmark
Guido van Rossum <guido@python.org>
parents:
diff changeset
224
b368be7b062a added "pystone" benchmark
Guido van Rossum <guido@python.org>
parents:
diff changeset
225 def Func1(CharPar1, CharPar2):
15305
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
226 CharLoc1 = CharPar1
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
227 CharLoc2 = CharLoc1
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
228 if CharLoc2 != CharPar2:
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
229 return Ident1
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
230 else:
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
231 return Ident2
2613
b368be7b062a added "pystone" benchmark
Guido van Rossum <guido@python.org>
parents:
diff changeset
232
b368be7b062a added "pystone" benchmark
Guido van Rossum <guido@python.org>
parents:
diff changeset
233 def Func2(StrParI1, StrParI2):
15305
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
234 IntLoc = 1
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
235 while IntLoc <= 1:
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
236 if Func1(StrParI1[IntLoc], StrParI2[IntLoc+1]) == Ident1:
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
237 CharLoc = 'A'
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
238 IntLoc = IntLoc + 1
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
239 if CharLoc >= 'W' and CharLoc <= 'Z':
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
240 IntLoc = 7
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
241 if CharLoc == 'X':
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
242 return TRUE
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
243 else:
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
244 if StrParI1 > StrParI2:
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
245 IntLoc = IntLoc + 7
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
246 return TRUE
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
247 else:
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
248 return FALSE
2613
b368be7b062a added "pystone" benchmark
Guido van Rossum <guido@python.org>
parents:
diff changeset
249
b368be7b062a added "pystone" benchmark
Guido van Rossum <guido@python.org>
parents:
diff changeset
250 def Func3(EnumParIn):
15305
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
251 EnumLoc = EnumParIn
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
252 if EnumLoc == Ident3: return TRUE
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 6567
diff changeset
253 return FALSE
2613
b368be7b062a added "pystone" benchmark
Guido van Rossum <guido@python.org>
parents:
diff changeset
254
b368be7b062a added "pystone" benchmark
Guido van Rossum <guido@python.org>
parents:
diff changeset
255 if __name__ == '__main__':
31315
cd7b70a4c440 The script now takes an optional command-line argument to specify how many
Alex Martelli <aleaxit@gmail.com>
parents: 24604
diff changeset
256 import sys
cd7b70a4c440 The script now takes an optional command-line argument to specify how many
Alex Martelli <aleaxit@gmail.com>
parents: 24604
diff changeset
257 def error(msg):
cd7b70a4c440 The script now takes an optional command-line argument to specify how many
Alex Martelli <aleaxit@gmail.com>
parents: 24604
diff changeset
258 print >>sys.stderr, msg,
cd7b70a4c440 The script now takes an optional command-line argument to specify how many
Alex Martelli <aleaxit@gmail.com>
parents: 24604
diff changeset
259 print >>sys.stderr, "usage: %s [number_of_loops]" % sys.argv[0]
cd7b70a4c440 The script now takes an optional command-line argument to specify how many
Alex Martelli <aleaxit@gmail.com>
parents: 24604
diff changeset
260 sys.exit(100)
cd7b70a4c440 The script now takes an optional command-line argument to specify how many
Alex Martelli <aleaxit@gmail.com>
parents: 24604
diff changeset
261 nargs = len(sys.argv) - 1
cd7b70a4c440 The script now takes an optional command-line argument to specify how many
Alex Martelli <aleaxit@gmail.com>
parents: 24604
diff changeset
262 if nargs > 1:
cd7b70a4c440 The script now takes an optional command-line argument to specify how many
Alex Martelli <aleaxit@gmail.com>
parents: 24604
diff changeset
263 error("%d arguments are too many;" % nargs)
cd7b70a4c440 The script now takes an optional command-line argument to specify how many
Alex Martelli <aleaxit@gmail.com>
parents: 24604
diff changeset
264 elif nargs == 1:
cd7b70a4c440 The script now takes an optional command-line argument to specify how many
Alex Martelli <aleaxit@gmail.com>
parents: 24604
diff changeset
265 try: loops = int(sys.argv[1])
cd7b70a4c440 The script now takes an optional command-line argument to specify how many
Alex Martelli <aleaxit@gmail.com>
parents: 24604
diff changeset
266 except ValueError:
cd7b70a4c440 The script now takes an optional command-line argument to specify how many
Alex Martelli <aleaxit@gmail.com>
parents: 24604
diff changeset
267 error("Invalid argument %r;" % sys.argv[1])
cd7b70a4c440 The script now takes an optional command-line argument to specify how many
Alex Martelli <aleaxit@gmail.com>
parents: 24604
diff changeset
268 else:
cd7b70a4c440 The script now takes an optional command-line argument to specify how many
Alex Martelli <aleaxit@gmail.com>
parents: 24604
diff changeset
269 loops = LOOPS
cd7b70a4c440 The script now takes an optional command-line argument to specify how many
Alex Martelli <aleaxit@gmail.com>
parents: 24604
diff changeset
270 main(loops)