djhenderson / python-graph

Automatically exported from code.google.com/p/python-graph
Other
0 stars 0 forks source link

Add performance metrics to the test suite #83

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I'm in the middle of migrating my use of Edmonds-Karp from a custom adjacency 
matrix implementation to the python-graph implementation. It seems to slow 
things down by about 4x, so I'll take a look at creating a performance patch 
for minmax.py.

In the mean time, could we add performance metrics to the test suite? Something 
as simple as the following would do:

> startTime = time.time()
> doStuff
> self.assert_(time.time() - startTime < 0.2) # must take less than 200ms

I have something similar in 
http://github.com/bradbeattie/Election-Web-Service/blob/master/tests/test_schulz
e_stv_performance.py that's helped me inch towards performance gains.

Original issue reported on code.google.com by bradbeattie on 20 Aug 2010 at 9:34

GoogleCodeExporter commented 9 years ago
Sorry for the very late reply.

I decided not to tackle this, at least for now. As the running time of 
algorithms would vary from machine from machine, we can't hardcode these 
numbers. Also, our tests use a lot of randomization, which would also influence 
the running time.

Original comment by pmatiello on 23 Dec 2010 at 1:39