Unit tests are a great way to measure application functionality, but I'm wondering has anyone used them for some preliminary performance profiling?
What I'm talking about is running some profiling tool as part of an automated test run, saving performance results and then comparing them to some arbitrary value(s) so any bottlenecks would jump out. For example, I recently had a case that a Django tag library increased the template parsing time literally tenfold -- if the template parsing was built in unit tests it would be visible much sooner.
Are there any modules that would include this kind of measurement to a standard Django an/or Python setup? If not, do you have any particular suggestions or heads-up for writing my own? Thanks!