• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1from pybench import Test
2
3class CreateInstances(Test):
4
5    version = 2.0
6    operations = 3 + 7 + 4
7    rounds = 80000
8
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
67