[TIP] Use unittests for profiling?

Robert Collins robertc at robertcollins.net
Sun May 30 15:39:20 PDT 2010


So I'd just like to add that it really depends on what scale you're
optimising - once you start getting jitter in results it can be very
hard to performance tune with small data sets. Work (vs time) based
optimising is good - e.g., for bzr, we've looked at how many stat()
and readdir() calls happen, and how many times things get locked, or
network round trips. But for sheer performance tuning, there is a
pretty big tension between wanting a fast unit test suite, and wanting
to know that things scale well and performance is still good with
100000 file trees.

I'm sure similar concerns will emerge for other projects : my general
feeling is, reuse infrastructure, reuse fixtures, but don't conflate
correctness testing with performance tuning.

-Rob



More information about the testing-in-python mailing list