Too Slow For Zero

Your application is TooSlowForZero when it takes so long to run tests that you can't develop it any more. PrematureOptimization is the root of all evil, but when you're TooSlowForZero optimization is the next thing you have to do. Of course, not all optimization is evil. TooSlowForZero is a sign that there is something wrong with your design that (a) will need to be fixed before you ship the product and (b) is ruining your life. Go fix it now, and you will work faster tomorrow. -- JohnFarrell

Often, it's sufficient to optimize the tests. Don't confuse slow tests with a slow program - they're not necessarily the same thing. -- RonJeffries [Compare OptimizingUnitTests and OptimizationUnitTest]

The point is that sometimes your program is too slow to do anything but near-zero amounts of useful work, e.g. it takes 15 minutes to start up to test the feature you have just implemented; or while the UnitTests are running you have time to get a cup of tea and consequently get distracted. In these cases, optimization is not PrematureOptimization, even though you're not finished yet. Maybe the maxim to be derived is OptimizeWhenYourCodeIsTooSlow?.

BTW, when I started this page I was running my code under KlgJprobe, which took 2 hours for a simple test. By making some optimizations (coupled with ClarifyingRefactorings? of course), I have made the code twice or three times as fast. By installing a new version of KlgJprobe, I can now run a much larger test in only 20 minutes. Given that the results of the profile can generate 2 hours work for me, that's not too long. And here is another thing to remember - if you need to use a profiler, you have to have code that is fast enough to run in a reasonable time under the profiler. I have to be present to start and stop my program in the profiler; and the profiler runs maybe 20 times slower than real code. So in an 8 hour day, I cannot profile a test that would take more than 24 minutes real time. If a basic test of our system took 25 minutes, it would be too slow even to optimize, and that's what I would call TooSlowForZero! -- JohnFarrell


John, can you give a bit more explanation about the name? What does "zero" refer to?

Actually, I meant TooSlowForAnything?, but EltonJohn? didn't write a song with a name similar to that. [http://www.eltonography.com/songs/too_low_for_zero.html]

What does the song matter? Bernie wrote the lyrics, and they're far from his best.

RenameMe because this is a confusing page name.

CategoryOptimization


EditText of this page (last edited August 12, 2005) or FindPage with title or text search