~ubuntu-branches/debian/jessie/sqlalchemy/jessie

« back to all changes in this revision

Viewing changes to test/aaa_profiling/test_zoomark_orm.py

  • Committer: Bazaar Package Importer
  • Author(s): Piotr Ożarowski
  • Date: 2010-07-18 10:16:17 UTC
  • mfrom: (1.5.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20100718101617-63m6de864oav9fsw
Tags: 0.6.3-1
* New upstream release
* Add ${python:Breaks} in debian/control

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
"""Benchmark for SQLAlchemy.
2
2
 
3
 
An adaptation of Robert Brewers' ZooMark speed tests.
4
 
"""
 
3
An adaptation of Robert Brewers' ZooMark speed tests. """
 
4
 
5
5
 
6
6
import datetime
7
7
import sys
9
9
from sqlalchemy import *
10
10
from sqlalchemy.orm import *
11
11
from sqlalchemy.test import *
12
 
 
13
12
ITERATIONS = 1
14
 
 
15
13
dbapi_session = engines.ReplayableSession()
16
14
metadata = None
17
15
 
 
16
 
18
17
class ZooMarkTest(TestBase):
 
18
 
19
19
    """Runs the ZooMark and squawks if method counts vary from the norm.
20
 
 
21
 
    Each test has an associated `call_range`, the total number of accepted
22
 
    function calls made during the test.  The count can vary between Python
23
 
    2.4 and 2.5.
24
 
 
 
20
    
 
21
    Each test has an associated `call_range`, the total number of
 
22
    accepted function calls made during the test.  The count can vary
 
23
    between Python 2.4 and 2.5.
 
24
    
25
25
    Unlike a unit test, this is a ordered collection of steps.  Running
26
26
    components individually will fail.
27
 
 
 
27
    
28
28
    """
29
29
 
30
30
    __only_on__ = 'postgresql+psycopg2'
31
 
    __skip_if__ = ((lambda: sys.version_info < (2, 5)), )  # TODO: get 2.4 support
 
31
    __skip_if__ = lambda : sys.version_info < (2, 5),   # TODO: get 2.4
 
32
                                                        # support
32
33
 
33
34
    def test_baseline_0_setup(self):
34
35
        global metadata, session
35
 
 
36
36
        creator = testing.db.pool._creator
37
 
        recorder = lambda: dbapi_session.recorder(creator())
38
 
        engine = engines.testing_engine(options={'creator':recorder})
 
37
        recorder = lambda : dbapi_session.recorder(creator())
 
38
        engine = engines.testing_engine(options={'creator': recorder})
39
39
        metadata = MetaData(engine)
40
40
        session = sessionmaker()()
41
41
        engine.connect()
42
 
        
 
42
 
43
43
    def test_baseline_1_create_tables(self):
44
 
        zoo = Table('Zoo', metadata,
45
 
                    Column('ID', Integer, Sequence('zoo_id_seq'),
46
 
                           primary_key=True, index=True),
47
 
                    Column('Name', Unicode(255)),
48
 
                    Column('Founded', Date),
49
 
                    Column('Opens', Time),
50
 
                    Column('LastEscape', DateTime),
51
 
                    Column('Admission', Float),
52
 
                    )
53
 
 
54
 
        animal = Table('Animal', metadata,
55
 
                       Column('ID', Integer, Sequence('animal_id_seq'),
56
 
                              primary_key=True),
57
 
                       Column('ZooID', Integer, ForeignKey('Zoo.ID'),
58
 
                              index=True),
59
 
                       Column('Name', Unicode(100)),
60
 
                       Column('Species', Unicode(100)),
61
 
                       Column('Legs', Integer, default=4),
62
 
                       Column('LastEscape', DateTime),
63
 
                       Column('Lifespan', Float(4)),
64
 
                       Column('MotherID', Integer, ForeignKey('Animal.ID')),
65
 
                       Column('PreferredFoodID', Integer),
66
 
                       Column('AlternateFoodID', Integer),
67
 
                       )
 
44
        zoo = Table(
 
45
            'Zoo',
 
46
            metadata,
 
47
            Column('ID', Integer, Sequence('zoo_id_seq'),
 
48
                   primary_key=True, index=True),
 
49
            Column('Name', Unicode(255)),
 
50
            Column('Founded', Date),
 
51
            Column('Opens', Time),
 
52
            Column('LastEscape', DateTime),
 
53
            Column('Admission', Float),
 
54
            )
 
55
        animal = Table(
 
56
            'Animal',
 
57
            metadata,
 
58
            Column('ID', Integer, Sequence('animal_id_seq'),
 
59
                   primary_key=True),
 
60
            Column('ZooID', Integer, ForeignKey('Zoo.ID'), index=True),
 
61
            Column('Name', Unicode(100)),
 
62
            Column('Species', Unicode(100)),
 
63
            Column('Legs', Integer, default=4),
 
64
            Column('LastEscape', DateTime),
 
65
            Column('Lifespan', Float(4)),
 
66
            Column('MotherID', Integer, ForeignKey('Animal.ID')),
 
67
            Column('PreferredFoodID', Integer),
 
68
            Column('AlternateFoodID', Integer),
 
69
            )
68
70
        metadata.create_all()
69
 
 
70
71
        global Zoo, Animal
 
72
 
 
73
 
71
74
        class Zoo(object):
 
75
 
72
76
            def __init__(self, **kwargs):
73
77
                for k, v in kwargs.iteritems():
74
78
                    setattr(self, k, v)
 
79
 
 
80
 
75
81
        class Animal(object):
 
82
 
76
83
            def __init__(self, **kwargs):
77
84
                for k, v in kwargs.iteritems():
78
85
                    setattr(self, k, v)
 
86
 
 
87
 
79
88
        mapper(Zoo, zoo)
80
89
        mapper(Animal, animal)
81
 
        
 
90
 
82
91
    def test_baseline_1a_populate(self):
83
 
        wap = Zoo(Name=u'Wild Animal Park',
84
 
                           Founded=datetime.date(2000, 1, 1),
85
 
                           # 59 can give rounding errors with divmod, which
86
 
                           # AdapterFromADO needs to correct.
87
 
                           Opens=datetime.time(8, 15, 59),
88
 
                           LastEscape=datetime.datetime(2004, 7, 29, 5, 6, 7),
89
 
                           Admission=4.95,
90
 
                           )
 
92
        wap = Zoo(Name=u'Wild Animal Park', Founded=datetime.date(2000,
 
93
                  1, 1), Opens=datetime.time(8, 15, 59),
 
94
                  LastEscape=datetime.datetime( 2004, 7, 29, 5, 6, 7, ),
 
95
                  Admission=4.95)
91
96
        session.add(wap)
92
 
        sdz = Zoo(Name =u'San Diego Zoo',
93
 
                           # This early date should play havoc with a number
94
 
                           # of implementations.
95
 
                           Founded = datetime.date(1835, 9, 13),
96
 
                           Opens = datetime.time(9, 0, 0),
97
 
                           Admission = 0,
98
 
                           )
 
97
        sdz = Zoo(Name=u'San Diego Zoo', Founded=datetime.date(1835, 9,
 
98
                  13), Opens=datetime.time(9, 0, 0), Admission=0)  
99
99
        session.add(sdz)
100
 
        
101
 
        bio = Zoo(
102
 
                  Name = u'Montr\xe9al Biod\xf4me',
103
 
                  Founded = datetime.date(1992, 6, 19),
104
 
                  Opens = datetime.time(9, 0, 0),
105
 
                  Admission = 11.75,
106
 
                  )
 
100
        bio = Zoo(Name=u'Montr\xe9al Biod\xf4me',
 
101
                  Founded=datetime.date(1992, 6, 19),
 
102
                  Opens=datetime.time(9, 0, 0), Admission=11.75)
107
103
        session.add(bio)
108
 
        
109
 
        seaworld = Zoo(
110
 
                Name =u'Sea_World', Admission = 60)
 
104
        seaworld = Zoo(Name=u'Sea_World', Admission=60)
111
105
        session.add(seaworld)
112
 
        
 
106
 
113
107
        # Let's add a crazy futuristic Zoo to test large date values.
114
 
        lp = Zoo(Name =u'Luna Park',
115
 
                                  Founded = datetime.date(2072, 7, 17),
116
 
                                  Opens = datetime.time(0, 0, 0),
117
 
                                  Admission = 134.95,
118
 
                                  )
 
108
 
 
109
        lp = Zoo(Name=u'Luna Park', Founded=datetime.date(2072, 7, 17),
 
110
                 Opens=datetime.time(0, 0, 0), Admission=134.95)
119
111
        session.add(lp)
120
112
        session.flush()
121
 
        
 
113
 
122
114
        # Animals
123
 
        leopard = Animal(Species=u'Leopard', Lifespan=73.5,)
 
115
 
 
116
        leopard = Animal(Species=u'Leopard', Lifespan=73.5)
124
117
        session.add(leopard)
125
118
        leopard.ZooID = wap.ID
126
 
        leopard.LastEscape = datetime.datetime(2004, 12, 21, 8, 15, 0, 999907)
127
 
        
 
119
        leopard.LastEscape = \
 
120
                datetime.datetime(2004, 12, 21, 8, 15, 0, 999907, )
128
121
        session.add(Animal(Species=u'Lion', ZooID=wap.ID))
129
122
        session.add(Animal(Species=u'Slug', Legs=1, Lifespan=.75))
130
123
        session.add(Animal(Species=u'Tiger', ZooID=sdz.ID))
131
 
        
 
124
 
132
125
        # Override Legs.default with itself just to make sure it works.
 
126
 
133
127
        session.add(Animal(Species=u'Bear', Legs=4))
134
128
        session.add(Animal(Species=u'Ostrich', Legs=2, Lifespan=103.2))
135
129
        session.add(Animal(Species=u'Centipede', Legs=100))
136
 
        
137
 
        session.add(Animal(Species=u'Emperor Penguin', Legs=2, ZooID=seaworld.ID))
138
 
        session.add(Animal(Species=u'Adelie Penguin', Legs=2, ZooID=seaworld.ID))
139
 
        
140
 
        session.add(Animal(Species=u'Millipede', Legs=1000000, ZooID=sdz.ID))
141
 
        
 
130
        session.add(Animal(Species=u'Emperor Penguin', Legs=2,
 
131
                    ZooID=seaworld.ID))
 
132
        session.add(Animal(Species=u'Adelie Penguin', Legs=2,
 
133
                    ZooID=seaworld.ID))
 
134
        session.add(Animal(Species=u'Millipede', Legs=1000000,
 
135
                    ZooID=sdz.ID))
 
136
 
142
137
        # Add a mother and child to test relationships
 
138
 
143
139
        bai_yun = Animal(Species=u'Ape', Nameu=u'Bai Yun', Legs=2)
144
140
        session.add(bai_yun)
145
141
        session.add(Animal(Species=u'Ape', Name=u'Hua Mei', Legs=2,
146
 
                         MotherID=bai_yun.ID))
 
142
                    MotherID=bai_yun.ID))
147
143
        session.flush()
148
144
        session.commit()
149
145
 
150
146
    def test_baseline_2_insert(self):
151
147
        for x in xrange(ITERATIONS):
152
 
            session.add(Animal(Species=u'Tick', Name=u'Tick %d' % x, Legs=8))
 
148
            session.add(Animal(Species=u'Tick', Name=u'Tick %d' % x,
 
149
                        Legs=8))
153
150
        session.flush()
154
151
 
155
152
    def test_baseline_3_properties(self):
156
153
        for x in xrange(ITERATIONS):
 
154
 
157
155
            # Zoos
158
 
            WAP = list(session.query(Zoo).filter(Zoo.Name==u'Wild Animal Park'))
159
 
            SDZ = list(session.query(Zoo).filter(Zoo.Founded==datetime.date(1835, 9, 13)))
160
 
            Biodome = list(session.query(Zoo).filter(Zoo.Name==u'Montr\xe9al Biod\xf4me'))
161
 
            seaworld = list(session.query(Zoo).filter(Zoo.Admission == float(60)))
162
 
            
 
156
 
 
157
            WAP = list(session.query(Zoo).filter(Zoo.Name
 
158
                       == u'Wild Animal Park'))
 
159
            SDZ = list(session.query(Zoo).filter(Zoo.Founded
 
160
                       == datetime.date(1835, 9, 13)))
 
161
            Biodome = list(session.query(Zoo).filter(Zoo.Name
 
162
                           == u'Montr\xe9al Biod\xf4me'))
 
163
            seaworld = list(session.query(Zoo).filter(Zoo.Admission
 
164
                            == float(60)))
 
165
 
163
166
            # Animals
164
 
            leopard = list(session.query(Animal).filter(Animal.Species == u'Leopard'))
165
 
            ostrich = list(session.query(Animal).filter(Animal.Species==u'Ostrich'))
166
 
            millipede = list(session.query(Animal).filter(Animal.Legs==1000000))
167
 
            ticks = list(session.query(Animal).filter(Animal.Species==u'Tick'))
 
167
 
 
168
            leopard = list(session.query(Animal).filter(Animal.Species
 
169
                           == u'Leopard'))
 
170
            ostrich = list(session.query(Animal).filter(Animal.Species
 
171
                           == u'Ostrich'))
 
172
            millipede = list(session.query(Animal).filter(Animal.Legs
 
173
                             == 1000000))
 
174
            ticks = list(session.query(Animal).filter(Animal.Species
 
175
                         == u'Tick'))
168
176
 
169
177
    def test_baseline_4_expressions(self):
170
178
        for x in xrange(ITERATIONS):
171
179
            assert len(list(session.query(Zoo))) == 5
172
180
            assert len(list(session.query(Animal))) == ITERATIONS + 12
173
 
            assert len(list(session.query(Animal).filter(Animal.Legs==4))) == 4
174
 
            assert len(list(session.query(Animal).filter(Animal.Legs == 2))) == 5
175
 
            assert len(list(session.query(Animal).filter(and_(Animal.Legs >= 2, Animal.Legs < 20)))) == ITERATIONS + 9
176
 
            assert len(list(session.query(Animal).filter(Animal.Legs > 10))) == 2
177
 
            assert len(list(session.query(Animal).filter(Animal.Lifespan > 70))) == 2
178
 
            assert len(list(session.query(Animal).filter(Animal.Species.like(u'L%')))) == 2
179
 
            assert len(list(session.query(Animal).filter(Animal.Species.like(u'%pede')))) == 2
180
 
 
181
 
            assert len(list(session.query(Animal).filter(Animal.LastEscape != None))) == 1
182
 
            assert len(list(session.query(Animal).filter(Animal.LastEscape == None))) == ITERATIONS + 11
 
181
            assert len(list(session.query(Animal).filter(Animal.Legs
 
182
                       == 4))) == 4
 
183
            assert len(list(session.query(Animal).filter(Animal.Legs
 
184
                       == 2))) == 5
 
185
            assert len(list(session.query(Animal).filter(and_(Animal.Legs
 
186
                       >= 2, Animal.Legs < 20)))) == ITERATIONS + 9
 
187
            assert len(list(session.query(Animal).filter(Animal.Legs
 
188
                       > 10))) == 2
 
189
            assert len(list(session.query(Animal).filter(Animal.Lifespan
 
190
                       > 70))) == 2
 
191
            assert len(list(session.query(Animal).
 
192
                        filter(Animal.Species.like(u'L%')))) == 2
 
193
            assert len(list(session.query(Animal).
 
194
                        filter(Animal.Species.like(u'%pede')))) == 2
 
195
            assert len(list(session.query(Animal).filter(Animal.LastEscape
 
196
                       != None))) == 1
 
197
            assert len(list(session.query(Animal).filter(Animal.LastEscape
 
198
                       == None))) == ITERATIONS + 11
183
199
 
184
200
            # In operator (containedby)
185
 
            assert len(list(session.query(Animal).filter(Animal.Species.like(u'%pede%')))) == 2
 
201
 
186
202
            assert len(list(session.query(Animal).filter(
187
 
                    Animal.Species.in_((u'Lion', u'Tiger', u'Bear'))))) == 3
 
203
                    Animal.Species.like(u'%pede%')))) == 2
 
204
            assert len(list(session.query(Animal).
 
205
                    filter(Animal.Species.in_((u'Lion'
 
206
                       , u'Tiger', u'Bear'))))) == 3
188
207
 
189
208
            # Try In with cell references
190
 
            class thing(object): pass
 
209
            class thing(object):
 
210
                pass
 
211
 
191
212
            pet, pet2 = thing(), thing()
192
213
            pet.Name, pet2.Name = u'Slug', u'Ostrich'
193
 
            assert len(list(session.query(Animal).filter(Animal.Species.in_((pet.Name, pet2.Name))))) == 2
 
214
            assert len(list(session.query(Animal).
 
215
                    filter(Animal.Species.in_((pet.Name,
 
216
                       pet2.Name))))) == 2
194
217
 
195
218
            # logic and other functions
196
 
            name =u'Lion'
197
 
            assert len(list(session.query(Animal).filter(func.length(Animal.Species) == len(name)))) == ITERATIONS + 3
198
219
 
199
 
            assert len(list(session.query(Animal).filter(Animal.Species.like(u'%i%')))) == ITERATIONS + 7
 
220
            name = u'Lion'
 
221
            assert len(list(session.query(Animal).
 
222
                    filter(func.length(Animal.Species)
 
223
                       == len(name)))) == ITERATIONS + 3
 
224
            assert len(list(session.query(Animal).
 
225
                    filter(Animal.Species.like(u'%i%'
 
226
                       )))) == ITERATIONS + 7
200
227
 
201
228
            # Test now(), today(), year(), month(), day()
202
 
            assert len(list(session.query(Zoo).filter(and_(Zoo.Founded != None, Zoo.Founded < func.now())))) == 3
203
 
            assert len(list(session.query(Animal).filter(Animal.LastEscape == func.now()))) == 0
204
 
            assert len(list(session.query(Animal).filter(func.date_part('year', Animal.LastEscape) == 2004))) == 1
205
 
            assert len(list(session.query(Animal).filter(func.date_part('month', Animal.LastEscape) == 12))) == 1
206
 
            assert len(list(session.query(Animal).filter(func.date_part('day', Animal.LastEscape) == 21))) == 1
 
229
 
 
230
            assert len(list(session.query(Zoo).filter(and_(Zoo.Founded
 
231
                       != None, Zoo.Founded < func.now())))) == 3
 
232
            assert len(list(session.query(Animal).filter(Animal.LastEscape
 
233
                       == func.now()))) == 0
 
234
            assert len(list(session.query(Animal).filter(func.date_part('year'
 
235
                       , Animal.LastEscape) == 2004))) == 1
 
236
            assert len(list(session.query(Animal).
 
237
                    filter(func.date_part('month'
 
238
                       , Animal.LastEscape) == 12))) == 1
 
239
            assert len(list(session.query(Animal).filter(func.date_part('day'
 
240
                       , Animal.LastEscape) == 21))) == 1
207
241
 
208
242
    def test_baseline_5_aggregates(self):
209
243
        Animal = metadata.tables['Animal']
210
244
        Zoo = metadata.tables['Zoo']
211
 
        
 
245
 
212
246
        # TODO: convert to ORM
 
247
 
213
248
        for x in xrange(ITERATIONS):
 
249
 
214
250
            # views
 
251
 
215
252
            view = select([Animal.c.Legs]).execute().fetchall()
216
253
            legs = [x[0] for x in view]
217
254
            legs.sort()
218
 
 
219
 
            expected = {'Leopard': 73.5,
220
 
                        'Slug': .75,
221
 
                        'Tiger': None,
222
 
                        'Lion': None,
223
 
                        'Bear': None,
224
 
                        'Ostrich': 103.2,
225
 
                        'Centipede': None,
226
 
                        'Emperor Penguin': None,
227
 
                        'Adelie Penguin': None,
228
 
                        'Millipede': None,
229
 
                        'Ape': None,
230
 
                        'Tick': None,
231
 
                        }
232
 
            for species, lifespan in select([Animal.c.Species, Animal.c.Lifespan]
233
 
                                            ).execute().fetchall():
 
255
            expected = {
 
256
                'Leopard': 73.5,
 
257
                'Slug': .75,
 
258
                'Tiger': None,
 
259
                'Lion': None,
 
260
                'Bear': None,
 
261
                'Ostrich': 103.2,
 
262
                'Centipede': None,
 
263
                'Emperor Penguin': None,
 
264
                'Adelie Penguin': None,
 
265
                'Millipede': None,
 
266
                'Ape': None,
 
267
                'Tick': None,
 
268
                }
 
269
            for species, lifespan in select([Animal.c.Species,
 
270
                    Animal.c.Lifespan]).execute().fetchall():
234
271
                assert lifespan == expected[species]
235
 
 
236
272
            expected = [u'Montr\xe9al Biod\xf4me', 'Wild Animal Park']
237
 
            e = select([Zoo.c.Name],
238
 
                       and_(Zoo.c.Founded != None,
239
 
                            Zoo.c.Founded <= func.current_timestamp(),
240
 
                            Zoo.c.Founded >= datetime.date(1990, 1, 1)))
 
273
            e = select([Zoo.c.Name], and_(Zoo.c.Founded != None,
 
274
                       Zoo.c.Founded <= func.current_timestamp(),
 
275
                       Zoo.c.Founded >= datetime.date(1990, 1, 1)))
241
276
            values = [val[0] for val in e.execute().fetchall()]
242
277
            assert set(values) == set(expected)
243
278
 
244
279
            # distinct
245
 
            legs = [x[0] for x in
246
 
                    select([Animal.c.Legs], distinct=True).execute().fetchall()]
 
280
 
 
281
            legs = [x[0] for x in select([Animal.c.Legs],
 
282
                    distinct=True).execute().fetchall()]
247
283
            legs.sort()
248
284
 
249
285
    def test_baseline_6_editing(self):
250
286
        for x in xrange(ITERATIONS):
 
287
 
251
288
            # Edit
252
 
            SDZ = session.query(Zoo).filter(Zoo.Name==u'San Diego Zoo').one()
 
289
 
 
290
            SDZ = session.query(Zoo).filter(Zoo.Name == u'San Diego Zoo'
 
291
                    ).one()
253
292
            SDZ.Name = u'The San Diego Zoo'
254
293
            SDZ.Founded = datetime.date(1900, 1, 1)
255
294
            SDZ.Opens = datetime.time(7, 30, 0)
256
295
            SDZ.Admission = 35.00
257
 
            
 
296
 
258
297
            # Test edits
259
 
            SDZ = session.query(Zoo).filter(Zoo.Name==u'The San Diego Zoo').one()
 
298
 
 
299
            SDZ = session.query(Zoo).filter(Zoo.Name
 
300
                    == u'The San Diego Zoo').one()
260
301
            assert SDZ.Founded == datetime.date(1900, 1, 1), SDZ.Founded
261
 
            
 
302
 
262
303
            # Change it back
 
304
 
263
305
            SDZ.Name = u'San Diego Zoo'
264
306
            SDZ.Founded = datetime.date(1835, 9, 13)
265
307
            SDZ.Opens = datetime.time(9, 0, 0)
266
308
            SDZ.Admission = 0
267
 
            
 
309
 
268
310
            # Test re-edits
269
 
            SDZ = session.query(Zoo).filter(Zoo.Name==u'San Diego Zoo').one()
270
 
            assert SDZ.Founded == datetime.date(1835, 9, 13), SDZ.Founded
 
311
 
 
312
            SDZ = session.query(Zoo).filter(Zoo.Name == u'San Diego Zoo'
 
313
                    ).one()
 
314
            assert SDZ.Founded == datetime.date(1835, 9, 13), \
 
315
                SDZ.Founded
271
316
 
272
317
    def test_baseline_7_drop(self):
273
318
        session.rollback()
274
319
        metadata.drop_all()
275
320
 
276
 
    # Now, run all of these tests again with the DB-API driver factored out:
277
 
    # the ReplayableSession playback stands in for the database.
278
 
 
 
321
    # Now, run all of these tests again with the DB-API driver factored
 
322
    # out: the ReplayableSession playback stands in for the database.
 
323
    #
279
324
    # How awkward is this in a unittest framework?  Very.
280
325
 
281
326
    def test_profile_0(self):
282
327
        global metadata, session
283
 
 
284
 
        player = lambda: dbapi_session.player()
 
328
        player = lambda : dbapi_session.player()
285
329
        engine = create_engine('postgresql:///', creator=player)
286
330
        metadata = MetaData(engine)
287
331
        session = sessionmaker()()
288
332
        engine.connect()
289
 
        
 
333
 
290
334
    @profiling.function_call_count(4898)
291
335
    def test_profile_1_create_tables(self):
292
336
        self.test_baseline_1_create_tables()
300
344
        self.test_baseline_2_insert()
301
345
 
302
346
    # this number...
303
 
    @profiling.function_call_count(6783, {'2.6':7194, '2.7':7298,
304
 
                                            '2.7+cextension':7288,
305
 
                                            '2.6+cextension':7184})
 
347
 
 
348
    @profiling.function_call_count(6783, {
 
349
        '2.6': 7194,
 
350
        '2.7': 7298,
 
351
        '2.7+cextension': 7288,
 
352
        '2.6+cextension': 7184,
 
353
        })
306
354
    def test_profile_3_properties(self):
307
355
        self.test_baseline_3_properties()
308
356
 
309
357
    # and this number go down slightly when using the C extensions
310
 
    @profiling.function_call_count(22510, {'2.6':24055, '2.7':24214})
 
358
 
 
359
    @profiling.function_call_count(22510, {'2.6': 24055, '2.7': 24214})
311
360
    def test_profile_4_expressions(self):
312
361
        self.test_baseline_4_expressions()
313
362
 
314
 
    @profiling.function_call_count(1313, {'2.6+cextension':1236,
315
 
                                            '2.7+cextension':1207},
316
 
                                            variance=0.1)
 
363
    @profiling.function_call_count(1313, {'2.6+cextension': 1236,
 
364
                                   '2.7+cextension': 1207},
 
365
                                   variance=0.1)
317
366
    def test_profile_5_aggregates(self):
318
367
        self.test_baseline_5_aggregates()
319
368
 
323
372
 
324
373
    def test_profile_7_drop(self):
325
374
        self.test_baseline_7_drop()
326
 
 
327