3 ms·
Optimising the Haskell program "HLint" (30 secs to 1.3 secs)
- algorias 17y agoIsn't it a fallacy to benchmark by running a program over itself? If you find a redundant line of code in a function, you'll not only save on its execution but also on the execution of its analysis.
- viraptor 17y agoIf it was redundant, it wouldn't be needed in general - it doesn't matter if you removed it because of profiling on program X, or Y - as long as the code is correct, it would be a right thing to do. If the list of features is set and you're not doing a complete refactoring (only 10 or so lines out of several thousands were changed), I don't see a problem with this approach. You can (/should) always go back to the profiler if you find a better test case...
- ehsanul 17y agoA better test case would be several arbitrary pieces of code which do not change between the the benchmarks. Even if just a few lines change in the test case of thousands of lines of code, you cannot expect the change in analysis time required to be proportional. It might not matter in this particular case though, who knows.