As with suggestions given when a question is deemed to be subjective and a warning given, should the same not be done with question on performance?

I have noticed that with pretty much every single question that mentions performance, the answer is the same:

  • Use a profiler
  • Don't optimize prematurely

Almost all answers (from the more knowledgeable folk) follow the exact same path, with very few in between. Could we not give a small warning, saying something along the lines of:

"Remember that with performance, premature optimization is discouraged. Have you used a profiler to see the difference in performance? The answers to you question are likely to follow the same sentiment."

  • 1
    It wouldn't work. If you could put the allure of micro-optimization in a bottle, you'd out-sell Chanel. Aug 24, 2010 at 19:28
  • 1
    @Craig: You'd have to put it in vials. Aug 24, 2010 at 19:50
  • Or pills. (If my spam folder is to be believed, little blue diamond-shaped pills.) Aug 24, 2010 at 20:40
  • @Craig - I still reckon it's worth a tiny message :P Aug 24, 2010 at 20:56
  • On the issue of performance, it seems to me important enough that there's not much harm in repetition. Even if people buy into "profile, don't optimize prematurely" that advice is kinda general, and information is transferred much better if it is highly specific. Jan 15, 2012 at 3:06

1 Answer 1


Now that I have multiple examples, I have better support for why mechanical analysis of a question body, via string token checks, is horrible at trying to divine the intent of the question author. The only element that works rather successfully is the human element.

Which we already fail at concerning performance, because we turn up a lot of false positives using that as well! Speaking from personal experience, I got a lecture from Eric Lippert on premature optimization when all I cared about was actual significant mechanical issues like program breakdown or leakage or anything.

Mechanical checks would be worse because it is subject to cyclic degeneration. First you will catch all the people who state "I am not asking about optimization" as a false positive. Then you'll miss those users who miraculously have the ability to ask these questions without ever mentioning those words. The word catcher is updated to combat these problem users, which in turn produces even more false positives. You'll even start to catch users who aren't remotely asking about performance. Update the algorithm enough and it becomes impossible to ask a performance question without getting hit, but legitimate users will be inundated with warnings that are simply not applicable.

I imagine that it is very uncomfortable to have to deal with all of the bad performance questions that show up. But I don't think the maxim of "misery loves company" is really the best solution here. Not to mention, having someone walk you through why premature optimization is bad, or explain using a profiler, would be much nicer than having a machine plaster it in your face.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .