nose-devs/nose — Issue #5: writing performance tests
Author: jpellerin
Created: 2011-12-14 15:54:14+00:00
State: open

Hi,

This is not a bug, rather a fuzzy brainstorm/wishlist entry.
It is a common desire to test the performance of given snippets of code,
but there is to my knowledge no established tool/framework to do this. It
seems natural to at least re-use some unit testing infrastructure to do
this - all the test discovery mechanism and some pieces of the test running
mechanism should be identical.

Performance tests are usually not functional tests per se, so they should
be identified by a separate prefix, say "perf_" instead of "test_". I don't
know whether and where that would fit in nose's current architecture. I'm
not sure it could be written as a plugin (can it?).

Also, IMHO the most common case is to execute a given piece of code a
number of times and return the elapsed time, so I think it should be the
standard API. For example:

@with_setup(setup_foobar)
def perf_foobar(niters):
for i in xrange(niters):
# do stuff

(perf_foobar has to do the looping itself because of function call overhead)

Not sure where it leads, but I thought it may be useful to post this.

cheers

Google Code Info:
Issue #: 20
Author: antoine....@gmail.com
Created On: 2006-12-28T09:47:45.000Z
Closed On: