What is meta? ×

There are many questions of the form "which is faster?" They usually have the characteristics:

  • The difference tends to be in at most nanoseconds.
  • The compiler optimizes out the differences anyway.
  • The person asking the question has not tried profiling themselves.
  • One method is clearly better practice or clearer code.
  • The performance impact has not been demonstrated to occur in a bottleneck in the surrounding application.

The answers are usually a scatterfest of these points, and after some haggling the user manages to find the answer to what was essentially a trivia question that was presented in the form of a real life situation.

Given that this pattern happens with some uniformity, I'm wondering if there is room in the moderation of SO to deal with them uniformly. I'm experienced enough at SO to recognize this is a minor issue with potential to be better handled for both askers and answerers, but new enough to not know a great proposal to deal with them.

So, my question is, is this an issue we may have the tools to deal with through a change to our moderation policy.

Removed edits pertaining to "SO is not..." because 1) they were wrong and 2) that thread is gone.

share|improve this question
Good question, I'm interested in the answer. Its annoying when people dont even have baseline metrics, or at the end of the perf tuning they tell you the result is different in Release mode! –  Jeremy Thompson Jun 21 '12 at 1:17
You should be aware the bare WSOiN links in comments have caused problems Particularly in an uptick in rude or offensive comment flags If you do use it please don't just copy the answer title and link to it as others have suggested. –  Some Helpful Commenter Jun 21 '12 at 3:44
Consider including the following characteristic: All the methods are faster than others in their own particular problem case expertise. –  Sai Jul 3 '13 at 19:07

6 Answers 6

up vote 14 down vote accepted

We have two tools to deal with this - vote to close (as too broad) and down voting.

"Too broad" is usable in this case since it's not one of those answers that could be concretely pinned down - yes, you can profile, but that's also largely dependent on what kind of hardware you're running. Not everyone's running the same hardware as the OP, and everyone will have different approaches on their profiling suite.

"Down voting" is usable in this case since it by itself is not a useful question to ask.

There's one particular exception in my mind - if the question were to ask why one way is faster, and demonstrate that they profiled it a bit, then that would be a useful question. This has value in helping those researching the same methods/approach, and wondering if they can get better performance out of it.

share|improve this answer
I agree but as I've NEVER seen an SO user take such a hard stance, I was wondering if a cultural change or a notice of existing policy increased enforcement might be in order. We should also take care to distinguish real profiling questions, perhaps along the lines of, "Does the compiler optimize this out in most cases?" or "I have the following bottleneck in my application," or more specific, algorithm-oriented questions like "which causes more memory writes?" that might be lumped under profiling. –  AAA Jun 21 '12 at 0:47
I also include that. Questions that aren't just "Which is faster, x or y?" should be treated differently. I also note that both tools can be used, but it's really up to the person, and it depends on the situation. Even so, the tools do exist. –  Makoto Jun 21 '12 at 0:51
+1 for pointing out that these questions can be useful, if and only if the op puts in the necessary effort. –  jmort253 Jun 21 '12 at 1:02
Too localized too, most likely. –  Time Traveling Bobby Jun 21 '12 at 9:27
I used to watch the [performance] tag and cast automatic downvotes on all new questions about perf comparisons, but then I got bored of it after a short while and added the tag to ignore. I think I'll start doing it again. –  BoltClock's a Unicorn Jun 21 '12 at 9:50
Also, a number of these questions tend to be duplicates of others, and once in a while the duplicate may turn out to have a gem of an answer that e.g. describes and explains why exactly they're different. Of course, benchmarks would still be potentially useful to whichever canonical question that may be... –  BoltClock's a Unicorn Jun 21 '12 at 9:54

Don't close them. Just downvote them for poor research effort. They can still be validly answered by:

  • "this will almost certainly be optimized out"
  • someone generously doing profiling results
  • someone with enough expertise to detail out what the compiler will do

That third category is why I would hesitate to close these questions. Optimize for pearls, which means leaving some sand.

share|improve this answer

Vote to close such questions as "Questions must demonstrate a minimal understanding of the problem being solved." They didn't run a profiler on it, after all.

However, before you do that, consider the possibility that such questions (and their answers) actually do contain useful information. The answer "This will almost certainly be optimized out by the compiler. Use the code that is clearer" is certainly a valid answer to such a question, and provides valuable guidance to those reading the post later.

This is sort of a derivative of the "Too Localized" problem. Is a mundane syntax error "Too Localized?" Probably. Is an obscure compiler error "Too Localized?" Probably not; the same is true of these performance questions.

share|improve this answer

Now that NARQ is no longer an option, it seems to me that Too Broad is the best close reason for many of these. Questions like this (which is faster...) while looking like a specific question are not; they're really asking about an entire process or program that has many parts to it. Given that an acceptable question might be one tailored specifically to one element of the process/program, Too Broad seems right to me.

share|improve this answer

This is not always a reason to close, and sometimes it's exactly the type of question we want on SO, depending on the area of programming. Any language with very large data sets make the difference hard to profile, and the coder may need to seek expert advice.

For instance, with SQL query optimization, one of the key things that is discussed is performance. The specific query example may be nanoseconds different, but as data scales, it's not always intuitive or obvious what will occur. The difference on server loads is important, and this makes it a good question to ask.

For Matlab or similar computational programming languages, as well, it may be that performance is what needs to be addressed, and the time taken can scale in nonlinear and complex ways depending on all sorts of mathematical or arcane language specific reasons.

share|improve this answer

Lots of types of posts often show a lack of understanding or show a lack of research, not just performance questions/answers. Editing, commenting, downvoting and voting to close are the tools to use against this.

Is worth noting that there are 22,000 questions tagged with performance which is 44th by popularity. If we had a site performance.se it would be 7th on the list of se sites by # of questions. We clearly can't ban performance questions they way we would say poll or list questions.

Personally I don't like these questions and I usually will put a comment like. "When you measured it what were your results", and then see what happens. However sometimes the OP may actually get a good answer.

share|improve this answer
In your last link he did ask a legitimate question: "lighter in terms of compiler work and there any major differences?" The good answer asked this question, once you got around the filler of "did you profile it"? and such. –  AAA Jun 21 '12 at 2:46

You must log in to answer this question.

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