blob: 1dfc82f326b791e55931ae721c9a0a62a71a64db [file] [log] [blame]
Marc-André Lemburgc311f642006-04-19 15:27:33 +00001from pybench import Test
2
3class CreateInstances(Test):
4
Marc-André Lemburg7d9743d2006-06-13 18:56:56 +00005 version = 2.0
Marc-André Lemburgc311f642006-04-19 15:27:33 +00006 operations = 3 + 7 + 4
Marc-André Lemburg7d9743d2006-06-13 18:56:56 +00007 rounds = 80000
Marc-André Lemburgc311f642006-04-19 15:27:33 +00008
9 def test(self):
10
11 class c:
12 pass
13
14 class d:
15 def __init__(self,a,b,c):
16 self.a = a
17 self.b = b
18 self.c = c
19
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
28
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)
44
45 def calibrate(self):
46
47 class c:
48 pass
49
50 class d:
51 def __init__(self,a,b,c):
52 self.a = a
53 self.b = b
54 self.c = c
55
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
64
65 for i in xrange(self.rounds):
66 pass