From: Johan E. <jbc...@sw...> - 2013-11-07 22:09:38
|
Hi all, I added a "perf" build target and two simple performance tests to trunk. I highly recommend using Ninja for building instead of Make. Because we have so many subtargets, Ninja is much much faster when recompiling a piece of code. To generate Ninja build files: "cmake -G Ninja .....". It is pretty fun to write some test code, tweak it, and meanwhile run "ninja perf" to see if your changes have any effect (as you all know, the result is generally the opposite of what you'd expect). I'd like some input in how to improve the performance test framework. I believe we want separate .cpp files for each performance test. Each performance test should take a couple of 100 ms. And then each test should be done a couple of times (three times currently) to get some averaging going. To reduce the amount of duplicated code, how about I make a PerformanceTest base class, and let each performance test derive from that? The PerformanceTest class would have boilerplate and a virtual clock_t run_test() method that returns the clockticks for that test. Then all outputting is done in the base class, and the main of each test would look like: int main() { DerivedTest test; test.run(); } We could even add some standard paths and other "inputs" inside the baseclass, ready to be used by performance test code. I need your input on this. Yes, I am duplicating functionality of existing test frameworks. But I'd like to keep it simple and understandable. It doesn't have to be a very powerful system (imho). Cheers, Johan |