add @profiling.assert_method_count() decorator to test suite, set up some tests
Lets set up another profiling decorator that will dig into the hotshot stats to assert that the total function count of operations is within a given range (a max to ensure we havent added latency, a min to ensure that nothing weird is going on).
Then lets add some real tests to test/perf/ that run within the suite, and create tests for as many small operations as we can. Initial ideas are:
conn = pool.checkout()
conn.close()
conn = engine.connect()
conn.close()
s = table.select()
s.compile()
s = table.insert(values={'x':5})
s.compile()
engine.execute("select 1")
and then maybe some ORM things, like session.save(), session.flush(), attaching a child item to a parent where backrefs fire off, etc.
We can also add Robert's test suite in and adapt it to the new format.
Perhaps also, @profiling.assert_method_count() should also be sensitive to which dialect is in use. maybe @profiling.assert_method_count({'postgres':(50,100), 'sqlite':(30,50), 'default':(30,100)}) as an option.
Comments (4)
-
-
reporter first pass in b8e92e6692568476c8bbaa4b27d0e4eace0a3a81
-
reporter - changed status to resolved
nice "diff" embed :). Yeah, i think we can make improvements to this and also remove the "name" requirement from the decorator, but the basic idea is there now and a bunch of tests so im closing the ticket for now.
-
reporter - removed milestone
Removing milestone: 0.4.0 (automated comment)
- Log in to comment
Some way of tracking actual speed would also be very, very useful. (scaled CPU seconds?) Take 66428d908fb7b73886eec1c4920c7d8709bbca87, for example. This simple change in assignment style sped up the mass insert benchmark by 1.5%. 1.5% for an assignment!