Use ldexp(q, exp) instead of q*2.**exp in true division test, to avoid bogus failures...
[python.git] / Tools / pybench / Instances.py
blob1dfc82f326b791e55931ae721c9a0a62a71a64db
1 from pybench import Test
3 class CreateInstances(Test):
5 version = 2.0
6 operations = 3 + 7 + 4
7 rounds = 80000
9 def test(self):
11 class c:
12 pass
14 class d:
15 def __init__(self,a,b,c):
16 self.a = a
17 self.b = b
18 self.c = c
20 class e:
21 def __init__(self,a,b,c=4):
22 self.a = a
23 self.b = b
24 self.c = c
25 self.d = a
26 self.e = b
27 self.f = c
29 for i in xrange(self.rounds):
30 o = c()
31 o1 = c()
32 o2 = c()
33 p = d(i,i,3)
34 p1 = d(i,i,3)
35 p2 = d(i,3,3)
36 p3 = d(3,i,3)
37 p4 = d(i,i,i)
38 p5 = d(3,i,3)
39 p6 = d(i,i,i)
40 q = e(i,i,3)
41 q1 = e(i,i,3)
42 q2 = e(i,i,3)
43 q3 = e(i,i)
45 def calibrate(self):
47 class c:
48 pass
50 class d:
51 def __init__(self,a,b,c):
52 self.a = a
53 self.b = b
54 self.c = c
56 class e:
57 def __init__(self,a,b,c=4):
58 self.a = a
59 self.b = b
60 self.c = c
61 self.d = a
62 self.e = b
63 self.f = c
65 for i in xrange(self.rounds):
66 pass