77

I randomly came across this question.

It's obviously too broad: there are either too many possible answers, or good answers would be too long for this format (see the first answer, which has more than 15k characters).

Of course, it's an interesting question, and those who posted answers put a lot of effort into them.

That being said, is there some kind of "exception to the rule" allowed for specific cases (which ones?), or should this question be closed as too broad (or severely edited)?

Do note the question has been closed once and since reopened. A close vote is in progress. I personally voted to close it, but hey, maybe I'm wrong.

54
  • 15
    There are no exceptions. An off-topic question doesn't become on-topic because it's well written. The only reason it got that many votes is because, somehow, it got close to 20k views in 2 days. (wut, how the heck'd that happen?)
    – Cerbrus
    Commented May 23, 2016 at 10:14
  • 93
    It does seem inevitable that a question that provided entertainment to 20 thousand viewers in 2 days as well as inspiration to answerers must be closed. Of course we are not allowed to have fun, everybody is supposed to plow through the usual dreck. Commented May 23, 2016 at 10:28
  • 10
    Meanwhile, the question has 2 re-open votes again. This could well become one of those open/close flipping cases, unless a mod steps in and just locks it. Guys, Don't vote to reopen that. It's too broad for SO, regardless of the attention it got.
    – Cerbrus
    Commented May 23, 2016 at 11:15
  • 44
    @HansPassant Well actually I really don't like the general orientation SO took years ago when they decided people shouldn't ask again subjective or broad questions. Most interesting questions on SO are old open-ended question with great detailed answers. Now I vote to close such questions because it's now the way it works, but I would be more than happy if this kind of questions is allowed.
    – ken2k
    Commented May 23, 2016 at 11:19
  • 7
    With all the close votes aging away, I for sure can find worse questions to close, hence closing this question does not seem to me as a priority. If you need help to find crap just ping me : ) Commented May 23, 2016 at 12:37
  • 6
    Doesn't the amount of traffic the question gets count for anything regarding priority, @PetterFriberg? If the question gets re-opened, we're sending a message to thousands of visitors that broad questions like these are okay.
    – Cerbrus
    Commented May 23, 2016 at 12:40
  • 4
    In current situation this "message" seems like the least of our problems, I don't think the OP's of the 1K crap questions every day have ever seen that question. If they took the time to read it probably they would not post all the badly researched questions and then again maybe it would be enough that they read the help section Commented May 23, 2016 at 12:48
  • 70
    Where is the "too broad" part? It asks about leveraging knowledge of a specific microarchitecture to make C++ code run slower. Yes, there are a number of possible answers. But can anyone name a real programming problem to which there are not multiple answers? As usual, this is a case where a bunch of people who know little about the subject have decided, for whatever reason, to dig in their heels. I can't be the only person to have noticed that none of the close voters have earned so much as a bronze tag badge in C++ or assembly language.
    – Cody Gray Mod
    Commented May 23, 2016 at 12:58
  • 17
    @bra You have got to be kidding me. In what way is this question similar to any of the examples in that blog post? Compilable ASCII art? Nope. Programming jokes? Nah. The "reddited" issue is a red herring, just like the inflammatory title here. No, the fact that a question has been Reddited does not justify an exception to the rules. I don't think anyone would argue that. But "Peter Cordes posts long, detailed, exemplary answers" is not a reason to vote to close a question, and neither is "there are lots of ways to solve this problem." This question is not fundamentally problematic.
    – Cody Gray Mod
    Commented May 23, 2016 at 13:02
  • 10
    @cer Yes, I disagree with your characterization of the question. I cannot argue it is an exemplary question, and certainly there are ways that it can be improved. But compared to most of the junk that gets posted, this doesn't even come close to "low quality." Your judgment of "some noise" is fairly rude, I don't think a sentence of background at the beginning of a question is ever misplaced. We've already decided we don't care if a question is about a homework assignment, and what you call a "code dump" others would call "what he's tried so far." You've asked several of the same caliber.
    – Cody Gray Mod
    Commented May 23, 2016 at 13:09
  • 6
    "You've asked several of the same caliber." Irrelevant. Pointless to bring up here. The fact he's racking his brain over it doesn't add any value. We can't tell what he tried, as he just dumped the code in there without identifying the original code and his attempts.
    – Cerbrus
    Commented May 23, 2016 at 13:13
  • 9
    I find it quite telling of the culture this site has developed that when literally hundreds of questions that are total garbage pour in every day, people managed to dig their heels in to shut down something with +156 and 116 favorites. Obviously it was helpful to someone, perhaps not you. Possibly not surprising looking at the tag distribution for the close voters.
    – user3995702
    Commented May 23, 2016 at 18:50
  • 7
    I think people were just impressed by the scale of the answer, not by its actual usefulness. Commented May 23, 2016 at 19:42
  • 5
    Since the issue of niche optimization questions that got a lot of attention was brought up by Braiam above, it might be interesting to consider these similar questions: stackoverflow.com/q/11227809 stackoverflow.com/q/8547778, stackoverflow.com/q/17259877, stackoverflow.com/q/12264970, stackoverflow.com/q/3664272. Note how they are all C++-based optimization questions that were far from awe-inspiring when originally asked, but received outstanding answers and oodles of attention. Please explain to me how there is a real problem here.
    – Cody Gray Mod
    Commented May 24, 2016 at 8:08
  • 8
    Looking at the discussion and ansers, I'm SO tempted to vote to close this question as being too broad.... ;-)
    – Marco13
    Commented May 24, 2016 at 11:04

17 Answers 17

88

I locked the question while discussions were being held here, to prevent a close/reopen war.


Here's my (personal) take, based on something I read:

Every rule has an exception. If you happen to find a rule without an exception, then it's the exception to the rule that says that every rule has an exception.

Half of my canonicals are super broad, they're useful, not despite of that, but because of that.

The reason we have "too broad" is not only because "the answer would not be useful because it'd be too big", but also because "no one would answer that because it'd take writing a book to do it", only in this case, it was interesting enough to be answered, and answered well.

TL;DR - I'm in favor of leaving it open, despite it fitting the criteria of "too broad".

31
  • 9
    This would mean that a "Do my homework for me" question that got a good answer (Which is what this is), would be okay. Is that the message we want to send?
    – Cerbrus
    Commented May 23, 2016 at 12:19
  • 47
    This is not a "do my homework for me" this is a "I have this homework assignment, I did some of it but got stuck on the rest, any tips?" which is still broad, but infinitely better. Also, homework specifically isn't a problem, if the question is well written and shows proper research and attempt.
    – Madara's Ghost Mod
    Commented May 23, 2016 at 12:46
  • 13
    @Cerbrus. I kept the homework aspect in mind somewhat when answering. I think to make really good use of my answer, the OP has to understand some of what I'm saying, since I didn't include any code. I definitely didn't do his homework for him. I had a positive impression of the OP's response so far, e.g. "Still working with this, this has probably been the most fun I've had with a project." in a comment on my answer. So I have high hopes the OP is actually learning things, even if he didn't come up with all the ideas. Commented May 23, 2016 at 12:47
  • 2
    Would you say it's well written? (I wouldn't, see the list in my answer). We can't see what changes the OP made, so we can't really determine what he attempted.
    – Cerbrus
    Commented May 23, 2016 at 12:48
  • 1
    @Cerbrus Well, that's something that can be fixed via edit from someone who knows how to read his code, or OP himself with an edit.
    – Madara's Ghost Mod
    Commented May 23, 2016 at 12:50
  • 3
    @MadaraUchiha: Since the OP hasn't responded to anything on his question, I'm starting to doubt he is the original OP of this question. I might be a repost from somewhere else, by someone else.
    – Cerbrus
    Commented May 23, 2016 at 12:51
  • 2
    @Cerbrus one possible reason that OP doesn't respond to clarification requests is that flood of senseless upvotes from HN lemmings makes them believe that question is okay as is. At score +163/-7 inexperienced user may perceive these requests as boring nitpicking, "so many users like my question, it should be OK then"
    – gnat
    Commented May 23, 2016 at 14:19
  • 2
    @gnat: To add to the list of problems with that question...
    – Cerbrus
    Commented May 23, 2016 at 14:21
  • 8
    @TravisJ I don't think there's much to be expanded. I saw the beginning of a closing war, I decided it cut it short, until we reach agreement.
    – Madara's Ghost Mod
    Commented May 23, 2016 at 19:25
  • 5
    @Madara: Since you can edit locked posts, I propose a retitle to "Deoptimizing for the pipeline in Intel CPUs". Or maybe "Deoptimizing a Monte-Carlo simulation for ...". (It's really unfortunate that the OP still hasn't clarified which kind of i7, so we can't say "Intel SnB-family CPUs" or "Intel Nehalem"). Part of the problem with the question is the title. A lot of people have made generic C++ suggestions, like using Boost for something, that would be slow even on a non-pipelined CPU. Commented May 23, 2016 at 20:29
  • 7
    Hey guys, I guess I'm a little new to Stackoverflow and kind of missed a lot of what happened here. I didn't think my question would cause all of this and I apologize for any rules I broke. I plan to post some of my code tonight to show some of the changes once I figure out if the thread can be unlocked. I apologize I can't answer some of your questions because the lab that was given to us was pretty broad (I.E No specifics of the intel CPU, just I7.)
    – Cowmoogun
    Commented May 23, 2016 at 22:56
  • 2
    @Cowmoogun: I didn't expect anything like this either! Did you assignment give any requirements on how the code is to be compiled? Optimization enabled or not is by far the biggest thing, since -O0 vs. _O3 makes a huge difference to how source changes will affect the resulting asm. Also relevant, gcc / clang / MSVC / Intel's compiler? Any other constraints you can add to the question about what kind of source changes are within the scope of this task would help. If you have anything short enough to say in comments, Madara could edit it in, or could temporarily unlock it for you. Commented May 23, 2016 at 23:48
  • 2
    @PeterCordes the professor actually just sent an email that based on how he completed the lab we should only see up to a 17% increase so the way I'm interpreting it is that we can't make any changes whatsoever, that we can only reorder the existing c++ instructions. I plan to clarify with him tonight and I'll post to make sure. I should have had these answers before posting my questions and I apologize for that. I want to thank you tremendously, I was having issues understanding pipeline and caching but that first Agner's pdf has been a godsend.
    – Cowmoogun
    Commented May 24, 2016 at 0:24
  • 5
    @PeterCordes have you seen Open letter to students with homework problems? "Realize also that the answer we give you may be completely wrong for the path that your instructor is trying to get you to follow. Having previously fought through the problem ourselves, we know and understand when one can jump directly from il and when one needs to go through each step of ijkl in a process. Our answers may skip over steps that aren't needed for this particular problem, but may be critical for understanding the next assignment..."
    – gnat
    Commented May 24, 2016 at 7:48
  • 2
    It's been re-opened, and has already accumulated on close-vote. I just put a note at the bottom saying "please don't vote-to-close until discussion on meta is complete". If people don't respect that, you may need to lock it again, since it only takes 4 more people. Commented May 24, 2016 at 15:06
77

The question we're talking about here is an interesting and unique question.

It is a question to which giving an answer requires thought, and from those answers the reader can learn a lot. It teaches you about machine code, compiler optimizations, and everything that the C(++)/ASM guru might dream of, but is alien to the average developer using a third-generation abstraction-loaded language.

Or, in other words: what was the last time you were hit by branch prediction?

The type of questions that we have an abundance of, and that I'd like to see closed within seconds without getting an answer: "How to parse this JSON?", "Why does this SQL query give a parser error while I'm sure it's the correct syntax?", "Write a RegEx for me that matches this input", "How to recognize faces in images?" and "Which is faster?".

This is not such a question. Well, maybe the same amount of effort went into the question, but it's the answers that make this site.

By simply applying the "Too Broad" close reason to questions like this and at the same time keeping questions open that deserve to be closed even more, we're actively discouraging knowledgeable people from spreading their knowledge. Meanwhile, by letting the aforementioned questions stay open and be answered, we're not caring about the long-term usability of the site, but instead even more encouraging the reputation game.

The rules we currently have in place are the means to an end, namely quality control. You can close any question by too rigidly interpreting any of the rules, and we should not strive to do that. Instead we should look for the educational value a question, and especially its (potential) answers have.

12
  • 2
    This answer could do with less snark, to be honest. It doesn't really strengthen your argument.
    – Cerbrus
    Commented May 23, 2016 at 16:31
  • @Cerbrus I might indeed have tried to vent too much in a single answer about too many different things. Don't let that distract you from its core, though.
    – CodeCaster
    Commented May 23, 2016 at 16:37
  • "but just want a nice number...", "they may not be the asset...": I'm sure you can think of better ways to convey the same message.
    – Cerbrus
    Commented May 23, 2016 at 16:38
  • 1
    @Cerbrus like I said, those are things that don't really have to do with this question, but things I identify as a problem nevertheless, and to which I haven't taken the time to pick more carefully chosen words to express them. I'll try to do something about that, later.
    – CodeCaster
    Commented May 23, 2016 at 16:44
  • 1
    Ah, okay then :D
    – Cerbrus
    Commented May 23, 2016 at 16:45
  • 1
    "What was the last time you were hit by branch prediction?" Yesterday.
    – Lundin
    Commented May 24, 2016 at 7:05
  • 1
    +1 you take the words right out of my mouth. I for one appreciated the snark.
    – Cody Gray Mod
    Commented May 24, 2016 at 8:12
  • "It teaches you about machine code, compiler optimizations, and everything that the C(++)/ASM guru might dream of, but is alien to the average developer using a third-generation abstraction-loaded language." So does a book. The answers all together would result in a small book. The problem is that all the information is mixed there. Wouldn't it give a much better overview if all this information would be more disentangled in several single more specific Q&As? Commented May 24, 2016 at 9:52
  • 2
    @Trilarion you can write a book about any subject, even mere strings. That does not mean every question about strings is too broad. It's the difference between "How does an HTTP server work" versus "How to implement an HTTP server". The latter is too broad, the former can be answered with a couple of sentences.
    – CodeCaster
    Commented May 24, 2016 at 10:55
  • @CodeCaster I agree. What I wanted to say was that in general questions which teaches the reader a lot of things are likely to be very broad and may be better if split into several more focused sub-questions. Better in the sense of better overview and better organization of the information. Commented May 24, 2016 at 11:05
  • 2
    @Trilarion: A simple answer to the question would have been possible, but less interesting, so that's not what I wrote. That doesn't make the question too broad. Commented May 24, 2016 at 11:08
  • @PeterCordes I'm not sure if a simple answer that fully answers the question is possible. Commented May 24, 2016 at 11:12
49

This is one of those cases where we get into this weird "Telephone Game" situation over close reasons:

  • The close reasons were created to reflect problems that folks saw in questions that made them problematic to answer here;
  • Folks see the close reasons and go looking for the problems they describe, sometimes without actually understanding the problems that motivated their creation...
  • ...And then questions get closed for reasons that don't actually reflect a real problem.

The "too broad" close reason was motivated by a number of very common mistakes made by askers:

  • There are multiple questions being asked. Someone is trying to get a two-fer rather than just posting multiple, separate questions. This is closely related to...

  • Questions that try to cover too much ground. Asking for help solving a specific problem that arose while writing your OpenGL wireframe renderer is totally legit. Asking for advice on writing said renderer when you've barely more than a list of requirements is too much - a good answer would be a textbook on software design and probably include large portions of Foley, van Dam, Feiner and Hughes. These questions often transition gracefully into...

  • Questions that lack any specificity at all. Now we're in a situation where there are multiple "correct" answers because there are no criteria for proving anything incorrect! Questions asking for OpenGL tutorials or help designing systems for which no requirements are provided fall into this category, and often become not just too broad but overly opinion-based.

What we got here is a rather specific question that, in spite of its popularity, has managed to attract only 3 answers thus far. The longest answer is just shy of 20,000 characters, which is pretty long but still well shy of the 30,000 character limit and unlikely to reach it; in short, there's little evidence that the asker or other readers require the creation of a textbook or some insane quantity of speculative answers in order to solve the problem presented here.

Let's face it: we're talking about someone's homework problem. They took the time to describe where they were stuck, and others helped flesh it out into something that's clearly captured a lot of interest... but this is still just a class assignment, a little problem intended to teach a rather specific concept... Not the dreaded, "How do I write a social network that also makes waffles?" The most pressing issues with it were some minor ambiguities and omissions in the problem statement, which have now been addressed (apparently by the asker's professor).

In short, it wasn't all that problematic to start with and most of the problems it had have been fixed. Let's congratulate the folks involved on a job well-done and move on to other problems!

6
  • 3
    I was hoping you would weigh in on this conversation, and could not agree more with the outlook here. Now I just need to figure out how to bounty meta posts :P
    – Travis J
    Commented May 24, 2016 at 17:52
  • 3
    The OP actually didn't show any of his work, and should post an answer. The question code was the starting point given by the assignment. From that perspective, it's not much better than most homework questions. The assignment itself is an interesting question for SO, and I basically just answered it instead of anything the OP said. (Usually homework assignments don't make interesting SO questions directly, but this doesn't automatically disqualify a question. Other computer-architecture homework questions have gotten upvotes and good/useful answers in the past.) Commented May 24, 2016 at 18:32
  • 1
    Ah, I overlooked that then @Peter. Reading through the revision history, the question indeed started out quite poorly, though the first few edits were sufficient to make it at least understandable. As you say, not a reason to disqualify, but I'd probably have downvoted it if I'd seen it earlier.
    – Shog9
    Commented May 24, 2016 at 18:42
  • 1
    I'll show you when Wafflr takes off!
    – user3995702
    Commented May 24, 2016 at 20:04
  • 2
    Wish I could bounty this. One of the biggest problems on SE (not just SO) is that people forget the reason rules exist and care about the (frequently-subjectively-interpreted) letter of rules more than the problems the rules are supposed to fix.
    – DVK
    Commented May 25, 2016 at 13:44
  • I really miss the There are either too many possible answers, or good answers would be too long for this format, especially the first part. Now when ELU questions play the single-word-request guessing game we get dozens of zero-effort, one-liner "answers" but folks can no longer point to Too Broad saying that there are "too many possible answers" . Unfortunately. Case in point.
    – tchrist
    Commented Jul 9, 2017 at 16:46
24

Update: The professor posted some details, which I've copied to an "answer" on this meta. The original was posted in the wrong place and deleted.


It's somewhat broad as-is, but an edit from the OP could fix that. It isn't a fundamentally flawed question, because the too-broadness is in lack of details, not the whole question itself. Many people are overlooking the fact that it's about microarchitectural slowdowns from pipeline hazards, not C++ in general. It approaches a broad topic from a specific angle.

The OP has only just recently provided further clarifications in comments on this meta post, so it's probably time to unlock the question and make some edits. Normally it's ok for there to be some delay in shaping a question into ideal form, but unfortunately the question was widely publicized before it was the OP responded, or anyone else improved it. (A title edit to focus on the pipeline, not C++, would have helped a lot). I answered on the assumption that it would soon be improved, rather than waiting before that happened.


It's interesting enough to enough people to be an exception to the general rule that we don't want a lot of too-broad questions on SO. Besides the many comments on the SO post, it caught the interest of people on other forums like Reddit and ycombinator, where NKurz posted some results from testing it with different compilers. I assume that's the same Nathan Kurz who's posted interesting comments on Agner Fog's blog. So there are definitely people beyond just me with some detailed microarchitectural knowledge and interest that liked this question. Obviously it's not going to be interesting to everyone, but no SO question is.

IMO, this question is good enough to stay, even though there are several ways it could still be improved. It doesn't have to be perfect. A flawed question can be interesting. We can decide on a case-by-case basis to allow things like this without opening the floodgates.


In this case, what makes the question interesting is the idea of de-optimizing without simply bumping up the iteration counts or bloating the code. Also, having to justify your pessimizations as "diabolically incompetence", rather than intentional pessimization is really interesting. This is the new idea that people want to think about. The specific code in the question isn't what makes it interesting.

There are also aspects that can't change at this point, but would have made it a better question: e.g. a different choice of source-code to de-optimize. Code that didn't spend so much time in exp() and log() would make much more sense. Also, we can invent reasons to store things in memory, and memory stalls are a huge deal, but having some kind of data structure in the first place would have been nice.

Apparently the assignment was not intended to be very complicated, and it was only a "second semester" computer architecture course. I assumed that it must be a pretty advanced class to be studying Intel pipelines, because they are seriously complicated.


Many people have made suggestions based on the title ("deoptimizing a C++ program") that would slow down even a non-pipelined CPU. e.g. use Boost to get the compiler to generate some slow stuff using very few source lines. I think it's these suggestions that are off-topic and contribute to the impression that "too broad" is really a problem. OP hasn't done a good job of ruling out such source changes, though. This meta question got me thinking I should edit the question title to be more specific, but the question is locked ATM. (Thanks for not locking the answers, I might have more ideas to tighten up my long & rambling answer).


"obviously too broad" ... (see the first answer, which has more than 15k characters)

Too Broad applies when the minimum length of a sufficient answer is too big.

The fact that a long and detailed answer is possible isn't a problem, as long as short answers that don't go into detail could be good enough.

This isn't the case when a long answer would be required to correct all the misconceptions in a question. Or for many homework questions to an otherwise trivial question.

I think the fact that I could give a fairly detailed answer that covers many of the bases in only 2/3rd of the maximum 30k chars doesn't support the too-broad argument at all.

I could find 15k chars of things to say about performance considerations in many answers to direct questions, like SSE horizontal sums, or how to zero a register.


I had no idea this question was going to be popular! I've made several edits to shorten it and present the same information better, not just keep making it longer. One of the most important recent changes was including a TL;DR table of contents / summary of the more plausible suggestions that the OP could justify with the proper application of diabolical incompetence, and not just outright malice / obvious pessimization.

I've been toiling away writing answers with detailed microarchitectural justification for choosing one way of doing something over another (e.g. with SIMD vectors) for a long time now, and this is one of very few that's caught the interest of anyone outside of or . Another one being this one about popcnt of bits below a position.

I tend to write long/detailed answers, because I hate leaving out information that is relevant. I've had positive feedback from many people about the microarch details and technical depth of my previous answers, and I'd much rather write for an audience that appreciates that.

My approach to answering was to consider all the ways I can think of to stall or slow down a Sandybridge-family pipeline, and consider those stalls from the PoV of this program. So a few paragraphs are spent on stalls that we can't reasonably expect to create, like LCP stalls or self-modifying code. Or partial-register stalls, which are only a really big deal on Nehalem (the first i7).

Anyway, so even though I cover a lot of ground, I tried to tie every point back to the specific angle the question is coming from.

My answer as it stands now is kinda long, and could be ordered better. I wish SO markdown allowed collapsible sections to allow interesting asides to not get in the way of more important text.

13
  • 9
    "I tend to write long/detailed answers" Ya don't say ;-) (Not my -1)
    – Cerbrus
    Commented May 23, 2016 at 12:13
  • 5
    "interesting enough to most people to be an exception to the general rule". What makes you say that? Out of 20k visitors, only 100 (0.05%) favorited it. 0.75% upvoted it. Those are really insignificant numbers. Reddit doesn't provide a snapshot of the linked page, so a person will have to visit the page to see if he finds it interesting or not.
    – Cerbrus
    Commented May 23, 2016 at 12:26
  • 5
    @Cerbrus: I say that because I found it interesting, and so did the many other people that left comments with ideas, or discussed their ideas (and actual experimental timing results) on other forums. Also, the ratio of up to down votes on the question is currently 163:7. My answer has attracted only 2 downvotes so far, so clearly out of people that did vote, the response has been much more positive than negative. (I know more people upvote more often than they downvote, and many people decided it wasn't worth an upvote.) Commented May 23, 2016 at 12:34
  • 6
    Discussion on other forums is pretty irrelevant here. Different rules, different crowd. How many of those 163 upvotes come from users that don't regularly visit SO? How many of those upvotes are just joining in upvoting an exceptionally high voted Q/A pair? If the question were actually good, it'd have gotten 10 times the amount of upvotes.
    – Cerbrus
    Commented May 23, 2016 at 12:38
  • 2
    @Cerbrus: I reworded my answer to say "interesting to enough people", since most people don't actually delve into microarchitectural details. I agree it's of niche interest, but it absolutely is interesting to those of us who like this sort of thing. De-optimizing is a novel challenge. Commented May 23, 2016 at 12:57
  • Peter, what do you think about migrating it to code review? Maybe that's a good alternative?
    – Cerbrus
    Commented May 23, 2016 at 12:58
  • 3
    @Cerbrus: It might be a better fit there. There are convincing arguments that "help me optimize this code" questions belong on codereview. I'm kind of resistant to that because codereview usually focuses most on human readability aspects of code quality, not on performance. (and the chicken-and-egg problem of having most of the existing x86 asm / performance stuff on SO, but that's not a good argument.) Commented May 23, 2016 at 13:15
  • 5
    Better ask on the Code Review Meta site if they're okay with "deoptimizing" questions. That may not be their cup of tea. Aside from that, I think (as you have said before) that this is an Intel microarchitecture question in disguise, which is a better fit for Stack Overflow. I also don't really like the implicit suggestion to migrate this question to another site just because it makes certain people "feel funny." If it truly runs afoul of our guidelines, it should be closed outright, not pawned off on our neighbors. Of course, I don't think it does, it just caught someone's Monday morning ire.
    – Cody Gray Mod
    Commented May 23, 2016 at 13:21
  • Perhaps this is just not the right forum anymore for out-of-the-box questions and detailed, multi-aspect answers. This being said, I am not quite sure what other forum would welcome such posts. Perhaps CS.SE?
    – Matsmath
    Commented May 23, 2016 at 22:38
  • 3
    @Matsmath: This specific question is definitely not computer science. I've had positive responses to my detailed and technical answers on other questions, even though they're long, so I don't think that's the problem. All the real objections are to the question, which is problematic. Some people have used answer-length as a metric for too-broad, but that's bullshit because I could find 15k chars of stuff to say about performance considerations for a lot of SO questions. I look at it as "a detailed answer only took 2/3rd of the allowed space". :P Commented May 23, 2016 at 22:52
  • Editing the question and making it more specific is surely a good way. But then, what to do with the existing answers? I would leave it closed and start again with a better, more localized question. Maybe even leave the code out and first ask for possible de-optimizations of the microarchitecture. Then asking for each of these if they can be applied to the code. Would give very clear Q&As. Commented May 24, 2016 at 9:50
  • 1
    @Trilarion: You need some kind of code or at least description of what kind of code. Otherwise the right response would a link to agner.org/optimize and a downvote for "lack of research effort". And probably also a too-broad close reason. I mean, code can be memory-bound, or bottlenecked on one of many other things microarchitectural things. The kind of "more specific" that I was hoping for wouldn't invalidate the answers. I'm not keen on the question being changed to include some specific de-optimization attempts, since the starting code is nice and short. Commented May 24, 2016 at 10:01
  • 3
    I wish SO markdown allowed collapsible sections Please vote here: Collapsible Code Markup
    – Marc.2377
    Commented May 25, 2016 at 0:52
20

Reposting the professor's response

It's not really an answer to anything, but it should go somewhere and does explain some things.


I am the professor who assigned the program in the "deoptimizing a C++ program" thread. Because Stack Overflow does not appear to have a way of directly emailing the moderator, I am posting this question to answer some of the items raised in the other thread.

The lab CPUs are i7-4770s, 8GB.

The students have been exposed to the CPUID instruction and how to determine cache size, as well as intrinsics and the CLFLUSH instruction.

The actual assignment had two options -- the Monte Carlo simulation shown by the student who submitted it, as well as Whetstone. The comments about cache de-optimization were mostly oriented towards the Whetstone option.

The ground rules were intentionally vague. This was supposed to be a fun assignment which made people think about what they knew about the i7 architecture, which we had been covering for several weeks, concentrating on cache and pipelining issues. We had also done a lab using x87 floating point. Any collection of changes was not excluded from the assignment, including compiler options. Inline assembly was fine, and use of MMX rather than x87 was slower in one implementation. Writing your own square root algorithm was announced as being outside the pale.

This is a second semester architecture class using the Hennessy and Patterson book at a community college.

Since few of my students will actually go on to design hardware, my focus was on how to best make use of the hardware in a high level language. I am impressed by the variety and technical depth of many answers here.

I would prefer not to have any further discussion, but hope that the foregoing information extends the learning opportunity for the people who have dug into this problem.

With my best regards, Hoping to remain anonymous...


3
  • It's generally agreed that the Intel P6-family of microarchitectures ended with Nehalem (the first i7). Intel Sandybridge is regarded as the first of a new family of microarchitectures (all of which are sold under the i7 brand name), due to substantial changes to the internals. e.g. physical register file instead of storing operands in the ROB. uop cache. 2 load ports. Substantial changes to the internal uop format (can no longer micro-fuse indexed addressing modes). The decoders are different, too: producing 4 fused-domain uops per clock max, instead of 4 instructions -> 7 uops max. Commented May 24, 2016 at 12:15
  • 3
    So please don't call it "the i7 architecture", because that's nonsense. It makes little sense to lump SnB-family in with Nehalem but not Core 2 or earlier. When Nehalem was new, "Core i7" was sometimes used (even by Intel) as the name for the CPU family, but then Intel released SnB i7 CPUs... A lot of the basic stuff like partial-register stalls, partial flag stalls, and register read stalls work the same or very similarly in PPro and Nehalem, but differently in SnB-family. Just call it the SnB-family pipeline. Or the Haswell pipeline if you're talking about your lab computers. Commented May 24, 2016 at 12:22
  • "use of MMX rather than x87 was slower in one implementation". I'm not surprised, since MMX is integer-only. You'd have to use fixed-point math to do Monte-Carlo with MMX. Although perhaps you meant SSE? Commented May 24, 2016 at 12:29
14

Hard rules have no exceptions, that's why they are hard rules. For instance, a 600 character limit on comments is a hard limit. But when we say too broad, we already admit up front that it's not a hard rule. It's a soft, subjective rule.

So let's look at that clarification: "there are either too many possible answers, or good answers would be too long for this format". Nope, that's just two soft rules.

This is important, because an "exception to the rule" is a concept which tries to soften an otherwise hard rule, to make put one specific case on the other side of a sharp border. Example: Twitter is no longer counting URL's in its tweet length. This is a hard exception to a hard rule. But when the border is already fuzzy and subjective, there's no need to soften it.

So, back to the specific case at hand. Are there infinitely many unique answers? Not really. There are a few clear areas: ISA, registers, cache, memory bus. Is an answer necessarily too long? No, not even when the top-voted answer is too long (can't really blame the question for that).

(This doesn't mean I think it's a particularly well-written question, but's that is a down-vote reason instead of a close reason)

8
  • 7
    You already identified 4 possible areas for the answers to focus on. Other users could probably come up with a couple more. There's not a single clear "right" or "best" answer. -> Too broad.
    – Cerbrus
    Commented May 23, 2016 at 13:16
  • 1
    What is your bar for too broad then?
    – Barry
    Commented May 23, 2016 at 13:25
  • 15
    Of course answers can come up with multiple aspects of a question to focus on. That's almost guaranteed for any real-world programming problem, which are the types of questions we purport to entertain here. Certainly it is true for all interesting questions. The only questions with only one possible answer are "debug my code" questions, where the answer is that "you dereference a null pointer in line 42". Everyone agrees they dislike those, but then they fall victim to the typical Meta myopia and start proclaiming ridiculous standards where such questions would be the only ones allowed.
    – Cody Gray Mod
    Commented May 23, 2016 at 13:29
  • @Cerbrus: A question that would attract 4 answers, for each of those areas, would not be too broad. And that's assuming no answer addresses both. "Too broad" IMO is so many possible answers that the paginating logic can't show all the numbers of pages anymore.
    – MSalters
    Commented May 23, 2016 at 14:42
  • 3
    4 areas to answe in. Each possibly having multiple approaches (answers), @MSalters.
    – Cerbrus
    Commented May 23, 2016 at 14:55
  • I agree with this 100%. Also I think this reasoning applies well to this question of mine on programmers.se.
    – Marc.2377
    Commented May 23, 2016 at 18:35
  • @marc This isn't really the place to have a discussion about your Programmers.SE question. If you want to have that discussion, you should bring it up on their Meta. Personally, as I see so often, I think your title was what attracted most of the close votes. Question: "Can this be done in C#?" Answer: Yes. And so people think, dumb question, can't reasonably be answered, need to find a close vote reason. Pick anything, "too broad" sounds good. You should've asked more like "What specific limitations of C#/.NET would make it difficult to..."
    – Cody Gray Mod
    Commented May 24, 2016 at 8:20
  • One could split the question into 4 questions: Like: How to hit ISA with this? How to use registers badly with this? How misuse the cache with this? How to slow down the memory bus with this? These would all have been really good questions. Commented May 24, 2016 at 9:20
14

I am the original poster of that question. I'm in the midst of finals weeks and completing projects so I've been a little absent minded while I wait for clarification from my professor tonight. I'd like to preface this that I appreciate all of the help in answering the question and I want to apologize that I did not provide more information the Lab given to us was intentionally vague in terms of what specific CPU.

From what I understood his instructions as, we were to make the Monte Carlo simulation slower by just reordering the instruction set which the most voted answer went way beyond that (to the benefit of learning). The resources provided have been incredibly useful so far.

I'm new to this community and I really appreciate the help I've received, if there anything I can do to answer any more questions, please don't hesitate to ask. Still getting used to Stack Overflow so I'm sorry if I miss anything.

5
  • 10
    Don't worry about it, if we can't agree on something, how can you be expected to?
    – o11c
    Commented May 23, 2016 at 23:26
  • 2
    You can only modify the C++ source, though, right? You don't get to reorder the asm instructions manually. Even if you could, aggressive out-of-order microarchitectures like Intel's Nehalem and Sandybridge-family will still find the parallelism unless you change the program logic so it has different dependency chains. When the question said "using your knowledge of the i7 pipeline", I assumed it meant most of what I put in my answer was already covered in your class, and you just needed "diabolically incompetent" ways to justify causing these stalls! Commented May 24, 2016 at 0:00
  • 1
    (continuing the off-topic discussion from comments on Madara's answer): Sounds like my answer wasn't at all what the assignment was looking for. I don't think as many people would have found that sort of answer interesting, since it would probably just be some extra store-forwarding round-trips from g++ -O0 output, the kind of crap I complained about in the optimizing-with--O0 answer I linked near the top. Commented May 24, 2016 at 0:39
  • 3
    @petercordes Honestly your answer was the best answer in terms of helping me understand the pipeline and in the end that's what's going to help me complete this assignment. I don't want the answer to the problem, I just wanted some breadcrumbs to help lead me towards the right path and your answer with the resources led me there!
    – Cowmoogun
    Commented May 24, 2016 at 0:43
  • 2
    I was mostly commenting to laugh at how uninteresting the lab assignment sounds, compared to how interesting your question was. I think knowing exactly why code runs fast on a certain microarchitecture is really interesting, and I'm glad the massive popularity of the question got some more exposure for Agner Fog's guides, as well as some of the interesting stuff I had to say in the answer. I've noticed a trickle of votes for some of my other answers that I linked from that one, so it's neat to see people are actually following the links I dug up and put in :) Commented May 24, 2016 at 0:50
7

Would this question have been appropriate if the inverse question had been asked?

"How can I improve core i7 pipeline performance with this code?"

Is this "obviously" too broad? Microarchitecture optimisations surely are an appropriate topic for Stack Overflow so the topic should not be discounted out of hand. There may be a set of specific techniques used to optimise a given program for a given architecture. Just because there exists more than one or two techniques does not automatically make something too broad.

An unbounded set of answers or techniques certainly is too broad though. So how many correct answers N is too many?

Not too broad < N < Too Broad

What is N? Does N change given the topic? I feel this is the major sticking point here - what is "too broad"? I don't think this particular question meets that definition. The answers are focused, immediately relevant, useful to future visitors, and are not contradictory (answer 1 can be used alongside answer 2).

The popularity of a question or answer shouldn't have anything to do with whether or not a question/answer is on topic. The usefulness of a question and answer do. "Too broad" is subjective in some cases, so calling this question "obviously" broad is wrong IMO.

If the argument here is that the quality of the question is bad but the content is obviously useful, then err on the side of not closing, and either improve the question or encourage others to improve the question. Default closing should be reserved for truly awful questions with no redeeming qualities or very clearly off topic question.

Moderators should default to leaving a question open if there is significant disagreement. I think locking the question in this case was right to stop the ping ponging, but I would have preferred it to be locked in an open state (if that's possible) considering the topic wasn't being abused by drive by answerers.

Locking/closing questions sends certain signals, of which many in this community and others interpret as being negative. Questions in a grey area that are locked send very negative signals to participants in a question as well as external communities that may be following along. By all means lock/close anything not in a grey area (discussions for example), but err on the side of caution for those that are.

10
  • To counter your example, there are specific and enumerable scenarios in which one should use a linked list, but I would say that you could've strengthened the "not too broad" question with an example that made a callback to that. Otherwise, you're going to get a lot of confused people thinking that it's fine to use ArrayLists for their FIFO structure.
    – Makoto
    Commented May 24, 2016 at 0:48
  • You're right. I originally had many examples under each heading and trimmed it down. I'll make an edit. Commented May 24, 2016 at 1:16
  • 2
    Actually it's not totally obvious that "optimize this working code" is on-topic for SO. There are convincing arguments that such questions belong on codereview.SE. I'm not sure if the "for an i7 uarch" changes that. Codereview doesn't currently have many questions or answers focused on perf (AFAIK), and definitely few about x86 asm. That chicken-and-egg argument doesn't really hold water, though, since new sites have to start somehow. Commented May 24, 2016 at 1:24
  • 1
    I consider the code review site useful for architectural and style questions, not specific optimisation questions. That's a point of view that's probably subjective though. But when something is subjective, I still argue that default open is better than default closed, until some kind of consensus is reached. The original question could definitely be improved, but the focus on i7 pipelining grounds it firmly in SO territory IMO. Commented May 24, 2016 at 1:31
  • "what is "too broad"?" Practical definition of "too broad": if a single, comprehensive answer to the full question would be too long. And the way out is to split the question into smaller ones. Commented May 24, 2016 at 9:22
  • "I consider the code review site useful for architectural and style questions, not specific optimisation questions" You may only be talking about the actual interactions you've seen there, but "Performance" is very much officially on-topic at CodeReview, and (from the same link) "Architecture" is explicitly off-topic. Design and architecture are topics that Software Engineering would love for you to ask about.
    – jscs
    Commented May 24, 2016 at 18:45
  • 1
    @Trilarion I don't agree with that definition. That implies that information should be cut if it doesn't fit into a yet undefined length. The accepted answer could have been trimmed down significantly, but he went the extra mile by providing references and suggestions that weren't explicitly asked for but were still related and useful to the asker and future visitors. The close reason targets questions that require answers that are too many or too long. In this case the answer didn't have to be long. The author chose to make it so. Commented May 25, 2016 at 2:49
  • @JoshSmeaton With what definition would you agree? I see it as the practical approach to things. The length of a good, comprehensive answer is important. If a good answer would be the length of a book it would probably not be suitable for Q&A. Also I'm not sure if going the extra mile and delivering a much longer answer than necessary was a good idea here because in the end less people will read the whole thing (but those who do will learn a lot, so it's okay). Commented May 25, 2016 at 7:29
  • @Trilarion I guess I agree with the "single comprehensive answer" part if the answer required the length to explain properly. If an answer could be shorter but the answerer chooses for it to be longer that's not a problem with the question. As yet though, no one has defined a length in terms of words or characters as to what constitutes "too long". As Peter points out, he didn't reach the limit that SO allows, which is a hard limit. Should there be a soft limit too, and if so, who determines whether the hard or soft limit should apply. Commented May 26, 2016 at 1:38
  • @JoshSmeaton As I see it, the "too broad" close reason is a soft limit and it is decided by the users of StackOverflow. In rare cases though there is no consensus and then a close/reopen war would start. In that case moderators have to step in. I completely trust that they have a soft definition of "too broad" and can apply it here based on the discussion and all the argument for and against. So in this case: because we cannot agree, moderators have to decide. Commented May 26, 2016 at 7:37
2

"Too broad" is already a soft criteria. No need to add exceptions to it.

Also, we do not emphasize enough that question closed as "too broad" can be split into smaller topics and then are on-topic.

For the example question: While it is an interesting topic the answers are a long read. I would have preferred the splitting of the question into several sub-questions. I think this would result in better questions and answers and a better read overall. However it might be a bordercase of "too broad" - in principle one could write whole books about processor and compiler technology just for this single question.

"Too broad" just becomes too broad if one (or a few) full, comprehensive answer(s) would be too long (too long is again a soft criteria). In the example if the question remains open the information is unlikely to get organized better. I would either leave it closed or split the question into smaller parts.

A good focused similar question is branch prediction and a split of the example question into similar focused questions would be preferable in my eyes.

1

A post which seemingly helped so many users and garnished so many views while being well written is not a problem in my opinion.

Closure is supposed to be a tool that is used to combat low quality or behavior leading to negative effects such as spam or duplication. I don't see low quality here, I don't see spam or even the "broken window" side effect going forward.

The question is clear, there is code showing the exact scenario, and the question of what else could have been done is probably poorly worded but in the end resulted in a rather fantastic answer.

I support this question, and do not want to see it closed or deleted. I wish all questions were as intricate as this instead of asking about null exceptions, failed include references, array out of bounds, how to create an entire feature, how to fix an exception that literally states how to fix the problem in its message, etc. etc. etc.

Focus on removing garbage, not value.

8
  • 2
    stronger indicator... yeah sure
    – gnat
    Commented May 23, 2016 at 19:27
  • 2
    What are you trying to say @gnat? Use your words. Your link from Jeff Atwood has this to say "what we try to do at Stack Exchange is make sure that questions and answers are popular for the right reasons -- because they are amazing resources for learning from your peers"
    – Travis J
    Commented May 23, 2016 at 19:31
  • 5
    in this case upvotes only indicate that question was advertised to 20K readers at HN, nothing else. Your points made after "Closure is supposed to be..." etc look worth thinking about but part about indicator makes really little sense to me
    – gnat
    Commented May 23, 2016 at 19:38
  • 1
    @gnat - There are questions advertised on the hot network list at all times. While this may provide a small benefit, the result you seem to indicate is not wide spread which means this activity is related to the content and not the advertisement. Increased awareness is a double edged sword, and can easily result in a post receiving negative voting. There was even the idea recently that downvote threshholds could be used to assist in closure. The implication is that upvotes would indicate remaining open.
    – Travis J
    Commented May 23, 2016 at 20:01
  • I'd like to compare 5 close votes to 156 upvotes.
    – user3995702
    Commented May 23, 2016 at 21:54
  • @gnat Attention does not invalidate +/- ratios. More attention to a question offers equal chances for bad questions to be downvoted.
    – user3995702
    Commented May 23, 2016 at 21:56
  • 5
    chances are never equal @WilliamKappler. To start with, there are 3x more users who can only upvote (rep 15 to 125) than those who can choose whether to vote up or down. This already gives much better chances for advertised questions to get positive score. And only 1/4 of those who can vote down are able to see split-vote-count, meaning 3/4 of them are more likely to follow "snowball effect" of a high positive score without even noticing that someone else voted down
    – gnat
    Commented May 23, 2016 at 22:16
  • 1
    @WilliamKappler you may want to read the quote of yesterday, look for it on the comments on this question. Also meta.stackoverflow.com/questions/285471/…
    – Braiam
    Commented May 23, 2016 at 22:40
0

The question under discussion is a fine question to ask someone, and the answers are great answers to that question. However, the question is unlikely to help other readers in its current form because the entire thread is specific to the code in the question.

There are good paradigms and practices suggested in the answers that could be applied to any/all code, but in their current form, aren't applicable outside of the context of this question. So barring a rewrite of the question (and, therefore, the answers), the question should be closed and probably deleted. I would vote to close it, and probably wouldn't vote to undelete it.

5
  • 1
    Parallelizing with diabolical incompetence (shared atomic loop counter) is a very general-purpose de-optimization, and so is a store-forwarding stall. A lot of my answer would still apply with different sample code to be de-optimized. The purpose of the question is to understand what can stall an Intel Nehalem or SnB-family pipeline, not good C++ coding practices. The question title is unfortunate, because people seem think the question is broader than it really is, or aiming at a different purpose. Commented May 23, 2016 at 19:18
  • 4
    @PeterCordes I've told this to other people before, but if you see a question title that can be improved, improve it! If you think the question is really about something else, and can edit it to clarify what the question is asking and/or improve the scope, without invalidating the existing answers, please do so! I agree that the title is pretty horrible. The issue with the content of the post is that it doesn't really go into detail about what the issue is outside of the context of the OP's code. Right now the question seems like a code-anti-golf question... not really useful to readers.
    – TylerH
    Commented May 23, 2016 at 19:31
  • 2
    I often do edit question titles to make them more specific. I didn't realize that people were going to miss the point of the question, and only clued in to the title really being a problem after it was locked and this meta question opened. Before that I was too busy revising my answer to be better organized for the benefit of the boatloads of people that were viewing it! Commented May 23, 2016 at 19:53
  • 1
    @PeterCordes: If you have a better title in mind already, it might be worth dropping a comment for Madara Uchiha here proposing it. Mods can edit locked posts.
    – jscs
    Commented May 23, 2016 at 20:06
  • 1
    You seem to say the question is "too specific"? I think, the problem with the question is rather the organization of the answers. There is too much information spread around. One has to read a lot in order to get a clear picture. Would have been better if the question would have been split into several sub-questions. Commented May 24, 2016 at 9:45
-1

Let's turn the question around: If it didn't get popular, would you believe it deserved some kind of exception? If your answer is "no", then of course it should not. Quality of the posts are measured by their content in isolation. Not by the amount of votes, nor the presence of answers, or other factors.

Now, let's strip the question down of any distractors, like this:

My version of the question

Task

I've doing something, but I don't tell you what, I would like you to do it, here's what you need to do:

requirements

Here's the code you would be working with:

[code]

I've made some chances, but again, they are secret, that seems to be doing something, but I'm not sure what else to do to fulfill the requirements. A point to the right direction would be awesome, I appreciate any responses.

Tell me, is that good enough content that deserves to be treated differently?

10
  • Dude. You have 3k Rep. Surely you've heard about the case of "Closed due to historic significance", eh? Tell me what that is, other than an exception from the rules. It isn't solely about the question, atleast not imo, the answers raise the value the question offers by a lot.
    – Seth
    Commented May 23, 2016 at 14:34
  • 3
    @Seth It's locked, not closed and it is the exception, not some invitation to make further exceptions for new content, which is exactly what the locked message says. Besides, a lot of people object to historical locks even as they are (saying it makes them hard to maintain their old bad questions) meta.stackoverflow.com/q/289381
    – Frank
    Commented May 23, 2016 at 14:44
  • 9
    @Seth "Surely you've heard about the case of "Closed due to historic significance", eh?" It was posted less than 72 hours ago! What in the world is "historic" about this question? Our lack of timely moderation to prevent this whole issue altogether? Because, otherwise, I don't see the relationship.
    – Braiam
    Commented May 23, 2016 at 14:53
  • 1
    @Braiam My point is that - in some cases - there are exceptions. Sure, partly they're due to the standards that were applied back then, but some are "spared" due to the value they bring, despite fitting the scope of a close reason. Just saying, it's not always black & white.
    – Seth
    Commented May 23, 2016 at 15:00
  • 4
    @Seth what value you see in the question? Nobody has showed it to me. And as I pointed out to Peter, no one will find it.
    – Braiam
    Commented May 23, 2016 at 15:11
  • @Braiam The most valuable part for me is that you can read through the answer(s), and look out for things like this in your code for example. It's the same as "Good" vs "Bad" practices, knowing both benefits you more than just knowing the good practices.
    – Seth
    Commented May 23, 2016 at 15:17
  • "what value you see in the question?" Ugh. Maybe I'm taking this too personally, but that just rubs me the wrong way. I'm not surprised someone whose top tag is Javascript doesn't find the question valuable. I see plenty of value in the question, and both myself and Peter Cordes and others have repeatedly made arguments about the value that they see in the question, and more importantly, in the answers it has attracted. I'll grant that "potential answers" are, in general, a bad metric to judge question quality, but we don't have to speculate here. Don't miss the forest for the trees.
    – Cody Gray Mod
    Commented May 24, 2016 at 8:30
  • 1
    @CodyGray yeah, you are taking personally, you just recurred to an ad hominem attack instead of a sound argument. Congratulations. Why can't a guy which "top tag is javascript" push an argument about the quality of a question, which according to even the answerer, you also have no qualification to emit an opinion, if we follow your "argument", since your top tag is c++, instead of those more relevant ones.
    – Braiam
    Commented May 24, 2016 at 12:55
  • Hmm. It wasn't meant as an ad hominem. I didn't mean that you're stupid because you're a Javascript programmer. Just that someone who spends most of their time in a scripting language probably can't understand the appeal of a question about low-level, architecture-specific issues. I'm certainly not saying you can't have an opinion. Rather, I'm musing about why you still can't see the value that's been pointed out repeatedly. I've already commented elsewhere why I disagree with your "version" of the question, and I feel like you are judging the question like a machine, rather than an expert.
    – Cody Gray Mod
    Commented May 24, 2016 at 15:05
  • @CodyGray I don't spend "most of my time in a scripting language", in fact, my career is not even a STEM, my score in the tag is due a different matter, so any idea about myself are erred. And, again, nobody has pointed out the value outside "is a interesting question", which I repeatedly argued that it doesn't matter since nobody will ever find the information. Yes, is a interesting brain teaser, that I don't argue. My argument is that interesting information that can't be shared is not interesting anymore.
    – Braiam
    Commented May 24, 2016 at 20:12
-1

it's an interesting question, and people that answered it put a lot of effort into their answers.

The world is full of interesting programming questions. Programming is an interesting topic, and there is a practically infinite number of topics for discussion that would interest programmers. But the vast majority of those questions don't belong on Stack Overflow.

Indeed, for better or for worse, the most interesting questions are exactly those that don't belong on Stack Overflow. Because of their breadth, and also because often they have a strong opinion-based nature. These are the kinds of questions that we'd love to sit around with our friends and colleagues chatting about for hours, exploring every nook and cranny of the topic. But those are exactly the kind of rambling, wandering, impractical questions that are explicitly not on topic on Stack Overflow.

And frankly, it frustrates me that with a bit of gaming the system (like publicizing one's off-topic questions in a high-traffic off-site location), one can ignore the documented intended design and goals of Stack Overflow and come out way ahead like this.

It's true, we have such a hard time keeping up with the constant flow of sludge, and that's in fact why a meaty question like the one being discussed here appeals to the base instincts of the Stack Overflow community. It's so tempting to take a break from the daily grind and dig into a question like this one.

But that doesn't change the fact that the question is far too broad to be on-topic here on Stack Overflow. The guidelines are clear, and closing a question like that is always the right thing to do. Beyond that, personally I think it's unfortunate that a couple of people that showed such poor judgment in terms of compliance with site guidelines have been so richly rewarded in reputation points, as it dilutes whatever meaning those points have. But, oh well…it's not really that big of a deal. They broke the rules, they got away with it, but as long as the question gets closed to prevent additional clutter and time-wasting on it, what's done is done and it's not worth worrying too much about that.

4
  • 1
    It's only "far too broad" if you missed the part about doing it by stalling the pipeline in an Intel CPU. When I answered, I read it as a novel twist on the kind of microarchitecture question that I geek out on. I didn't think it would have mass appeal. (And probably it shouldn't have gotten so much attention, but the title made some people miss the specific nature of the question.) It has its faults for sure, which the OP should have fixed, which is why I left a comment to that effect before answering. The broader topic is water-cooler fodder, but the actual question is specific enough. Commented May 23, 2016 at 21:12
  • 6
    The question, as is, is too broad. Meaning it should be closed as "Too broad". The OP can still edit the question if it's closed to make it specific.
    – Cerbrus
    Commented May 23, 2016 at 21:18
  • This SO blog post from 2010 covers this case: A question that's interesting but bends the rules. 2010 is ancient history in SO terms, though, so maybe things have changed and now we really do hate fun. You do make a really good point that being interesting is not sufficient justification for an exception, though. This question would be better in a format where replies to posts were themselves full-fledged posts that could include formatted code blocks. Commented May 24, 2016 at 1:14
  • Anyway, the OP has posted some clarifications in comments here on meta, so the original question can be unlocked and edited with improvements any time now. Usually there's a lot more time for the OP to clarify before a marginal question is closed as too-broad, but the OP was busy with end-of-term stuff and the question got tons of attention very early. Commented May 24, 2016 at 1:18
-2

First of all: In my opinion the "Too broad"-reason for Close-Votes is problematic itself, simply because the value of a question is - again, my opinion - not only defined by the question itself, but also by the answers contributed.

Sure, if the question didn't receive any attention whatsoever, chances are it'd be closed without discussion by now, but it has received quite a lot of attention over the course of 2 days (20k views, quite a number), and really good answers!

To me, this question is at most borderline-"Too broad". It's a clear question asking for possibilities to deoptimize a given code-fragment, and the community - judging by the amount of upvotes/views/favorites - likes this question or finds it interesting enough to upvote it.

Possible factors for that are that

  • it's very interesting to see a question like this (most questions nowadays go for optimization instead of deoptimization)
  • it helps people who want to increase their knowledge regarding slow processes

Sure, upvotes are by no means a universal indicator of what's good & what's not, but they do indicate interest. A few people put quite a lot of effort into answering this question, and I think the outcome makes this Q&A valid for the scope of SO.

Just to answer a few arguments of people voting to close this:

  • it should be closed since the top answer has 15k characters
    • As far as I know the max. amount of characters for answers is 30k, so why would you use half of that as justification of closing it?
  • "only" 0.75% of the visitors actually upvoted this question, and "only" 0.05% have addet it to their favorites
    • Let's be real here. I don't know the +/- count since I do not have that privilege unlocked yet, but the fact that it has a score of +150 clearly shows what the viewers thought of this question, eh?

All in all: I don't agree with closing this, simply because it carries value, it's appreciated by a large fraction of the community & it is something else. It's the exact opposite of what you see nowadays ("How do I make this code better?"), and that's refreshing.

6
  • 4
    The +150 is pretty meaningless considering the amount of views it got. Any Q/A that gets enough views will accumulate votes. Users that don't generally visit SO are often inclined to "Join in" on whatever the current voting trend is.
    – Cerbrus
    Commented May 23, 2016 at 16:34
  • 4
    "it's appreciated by a large fraction of the community" This is not true. Only a tiny percentage of viewers seem to "like" the question. "It is something else" So? That doesn't mean it should just stay.
    – Cerbrus
    Commented May 23, 2016 at 16:37
  • 1
    @Cerbrus Yeah. Right. Frequently viewed Q&As do get a lot of votes, but they tend not to have a score of +150 :) A tiny percentage of viewers seems to "like" the question Yes. The funny thing is just: You devalue the upvotes by saying "there should be more if it's good!!!1111!" & just ignore the fact that it has a positive score of 150. Jesus, please, stop enforcing your own opinion like that.
    – Seth
    Commented May 23, 2016 at 18:22
  • 3
    A positive of 150 means squat on a textbook "Too broad" question that got 26k views in 2 days. You're enforcing your opinion just as much as I am.
    – Cerbrus
    Commented May 23, 2016 at 18:32
  • 1
    Cerbrus is right that the huge number of votes are not a valid justification for keeping the question open. It is a niche question where good answers will center on obscure technical details. It's not really a C++ question, it's an Intel microarchitecture question that for some reason got way more views than normal. (Partly the C++ title, probably also the novel suggestion of de-optimizing instead of optimizing, which I agree is very neat). I think it should stay open, but my reasoning (detailed in my answer on this meta) is very different from yours. Commented May 23, 2016 at 19:30
  • "(most questions nowadays go for optimization instead of deoptimization)" I guess even this homework question goes for optimization in the end. It's a know your enemy kind of question. Commented May 24, 2016 at 9:40
-4

There should be no exceptions. An off-topic question doesn't become on-topic because it's gotten 20k views in a short time.
The only reason it got that many votes is because it got over 20k views in 2 days. This was possible because the question appears to have been linked on /r/programming, and some other sites.

At ~150 upvotes, only 0.75% of visitors actually upvoted the question. Only 100 (0.5%) favorited it. That doesn't really indicate the question is good.

The massive amount of views isn't an indication of quality, either.
Reddit has a massive userbase. If a user wants to see if a topic is interesting or not, he has to open the link (question, in this case). Regardless of if the user stays or not, the view count will increase.
(In the 2 hours this meta question existed so far, the question's gotten 1.2k views.)


That all said, the question is textbook "Too broad":

There are either too many possible answers, or good answers would be too long for this format.

The question itself consists of:

  • Some noise,
  • Followed by a (school-) assignment,
  • A code dump,
  • And a request to review / improve (mangle) the code.

Any other question like that, that didn't get those views would've either died a slow lonely (digital) death, or get closed before long.

14
  • 8
    Many of the viewers probably aren't regulars on SO, or aren't in the habit of voting. Clearly a lot of people are interested, and it has spawned discussions in other forums, too. I answered the question while it was still at about +3 or something, IIRC. Before I started getting more ideas from comments, my answer was like this: already fairly long and detailed. Even the very initial response to the question (from SO regulars) was positive, with more upvotes than close votes. Commented May 23, 2016 at 12:19
  • 5
    @PeterCordes: Even the discussion on there has some users saying it's too broad for SO. The problem is that the question got that much attention from outside of SO, at very early stages. If it didn't get the attention, I wouldn't be surprised if it had died a silent, quiet death...
    – Cerbrus
    Commented May 23, 2016 at 12:23
  • 1
    Most questions have a very small ratio of upvotes to views. I'm not arguing it's a great question, just good enough to bend the rules for (and hope it is made less broad). Clearly the voting has been inflated, but beyond +25 or so, it feels like more of a lottery than an actual measure of question quality. I basically won the rep lottery by being in the right place at the right time to give an answer to this question that people liked, but I don't think that matters. The hugely inflated number of votes isn't the main argument for keeping this question. Commented May 23, 2016 at 12:24
  • 3
    Then what is, @PeterCordes?
    – Cerbrus
    Commented May 23, 2016 at 12:32
  • 4
    Since this last comment has some upvotes: See my answer on this question. tl;dr: Because it's a good-enough Intel-microarchitecture question that is interesting and useful in helping people that want to learn more about what specifically can make code run slow on modern CPUs. It's not as broad as some people are claiming. Commented May 23, 2016 at 19:42
  • 6
    The question isn't good at all by SO's standards. It's a code dump in which it is unclear what the OP attempted, and what the original code wants. There are a load of possible answers, and none of the possible answers is better than the other, unless you combine'm all into 1 long answer. That one long answer, as I'm sure you're well aware, is massive. That doesn't really work in the question's favour.
    – Cerbrus
    Commented May 23, 2016 at 19:56
  • 7
    @PeterCordes: Just so you're aware, data run by bluefeet suggests that many of the viewers are active, do vote, and have an average reputation of 6K.
    – Makoto
    Commented May 23, 2016 at 22:12
  • 4
    If you think the format of the question was particularly bad, then spend the effort improving the writing of the question, comment so the asker can improve the writing, or comment and wait for someone else to improve the writing. Closing a question that has formatting problems is awful, unless the question is obviously so low quality that there is no redemption. Commented May 23, 2016 at 23:43
  • 4
    You've said in several comments that the upvotes are largely due to attention on external sites, but there is a (low) minimum rep requirement to be able to upvote at all - so any voters must have already had an SO account with some useful contributions already. The claim that external views = votes following a trend is somewhat misleading (especially in light of the data from bluefeet).
    – Bob
    Commented May 24, 2016 at 0:22
  • @JoshSmeaton: I couldn't improve the post if I wanted to. It's locked.
    – Cerbrus
    Commented May 24, 2016 at 5:11
  • 1
    @Bob: The rep requirement to be able to downvote is significantly higher. (125). anyone can quickly get the 15 rep required to upvote.
    – Cerbrus
    Commented May 24, 2016 at 6:28
  • 1
    I have just done a quick check of the percentage of upvotes of the 500 questions that have >150 votes, the average is 0.29% of people upvoting, the median is 0.15. 5 & 0.02 being the min and max, In that context I would say that 0.75% is a well upvoted question
    – Michael B
    Commented May 24, 2016 at 8:48
  • @MichaelB: did your check consider the short timespan?
    – Cerbrus
    Commented May 24, 2016 at 9:20
  • 1
    @Cerbrus I didn't, it was just the raw vote / views count. Mostly I was curious of it to counter the "really insignificant numbers" claim that you made. It has a higher percentage of votes than most other questions with a similar vote count. I don't see how that would be any different whether that happens over a day, a week, or seven years, it is still people reading the question and hitting the up arrow as a result of believing it showed research effort and was useful and clear. ;)
    – Michael B
    Commented May 24, 2016 at 10:20
-4

For "too broad" specifically, the close reason is about the (possible) answers, not the question itself.

"Too many possible answers" really means something like "everybody could create a new answer that shares nothing in common with the rest of the answers". The fact that there can be more than one answer (or subanswer) should not be categorized like this.

"Too long for this format" is just a nice way of saying "it would be a waste of anyone's time to answer this."


From those perspectives, the question deserves to be left open, since the answers that exist are high quality, though perhaps the question should be edited slightly to fit the type of answers that are on-topic.

-18

I voted to close that question because rules have to be obeyed. Otherwise SO would have turned into a mess. So, no exceptions!

On the other hand, not only the question is interesting, but the answers are also very good (I learned a lot!).

To my mind, we may just leave it closed since it's obviously too broad. I wouldn't recommend its deletion, though.

12
  • 5
    "I voted to close that question because rules have to be obeyed". You are of course free to vote to close, but I would hope you had a better reason than that. "Rules must be obeyed" I just can't agree with. There are many situations where breaking the rules is the best cause of action. I just can't accept this as a reason. Commented May 23, 2016 at 19:20
  • @JesperJuhl: I'm pretty sure that first line was sarcasm.
    – Cerbrus
    Commented May 23, 2016 at 19:46
  • 4
    @Cerbrus, that reading doesn't seem to correspond well with the fact that ForceBru actually did vote to close as "Too Broad".
    – jscs
    Commented May 23, 2016 at 20:10
  • So, he was serious :P
    – Cerbrus
    Commented May 23, 2016 at 20:18
  • @Cerbrus, I was serious. Seriously, this question is too broad, and if something is too broad, a serious man should vote to close that. Being even more serious, this question is not serious enough to stay opened (I mean, that "they gave me an assignment and I was wondering how I could do it better" is not serious).
    – ForceBru
    Commented May 23, 2016 at 20:23
  • That I can agree with
    – Cerbrus
    Commented May 23, 2016 at 20:24
  • In many ways, Stack Overflow IS a mess already. It's hard to find anything, and there are many crap questions that stew for years because there's just so much stuff. I really wish that I had more close votes, but I try to use my precious few on the things that NOBODY wants.
    – Laurel
    Commented May 24, 2016 at 0:26
  • Then why did you ask this question? It is also quite broad, I can think of many different ways to generate large random numbers in C++, and so could the answerers. Same thing here: lots of ways to convert an array into a hash. And presumably here, though I can't say for sure, I don't know any Python. I'm not trying to pick on you, I'm just saying that either (1) you don't apply your "too broad" rule to all questions equally, or (2) this question really isn't "too broad."
    – Cody Gray Mod
    Commented May 24, 2016 at 8:36
  • 1
    @CodyGray, if you know any good solution that wasn't mentioned in the answers to my questions, you can write an answer, I'd be grateful if you did that :) To my mind, broad questions are difficult to answer because one could write a whole book to discuss all possibilities. E.g.: how do I make my code slower? How do I become a web designer? How to learn C++ as fast as possible? My questions ask for code, and are relatively simple (I mean, the code one may need to write won't probably exceed 20 lines), so, in my opinion, they're not so broad. I think too broad /= possibly broad.
    – ForceBru
    Commented May 24, 2016 at 9:37
  • I don't necessarily have anything better to offer as an answer to your question(s). But neither do I have anything more to contribute than Peter's answer already does to the question under discussion. The point is that any reasonable question can be considered "too broad" under the criteria you're trying to establish. There are lots of different ways to solve a problem. I don't know how all these people are missing it, but you have to read past the title of the question before deciding to close it. It is not a generic "how do I make my code slower" question, there are specific constraints.
    – Cody Gray Mod
    Commented May 24, 2016 at 12:43
  • You could certainly argue that Cowmoogun's question asks for code. They clearly only avoided doing so because they were concerned that people would then vote to close as a "do my work for me" question. You just can't win. I can write a book about just about any programming question, so that is a horrible standard for "too broad." I wish people would stop throwing it around like it meant something. No, you're right, the potential answers to your questions are probably relatively short, but that is neither an attribute of the question nor does it make your questions any less broad.
    – Cody Gray Mod
    Commented May 24, 2016 at 12:45
  • 1
    To be clear, I'm not trying to attack you. You don't need to defend your questions. I think they are perfectly valid. I'm just saying, I don't see the distinction between your questions and this question with regard to the "too broad" criteria. Except for the whole not looking past the title problem, and thinking that the entire question is "How do I make C++ code run slower?" Not only would that be too broad, more importantly, it would be a suck-ass question that I'd vote to close all day long. It fails the interesting and useful test.
    – Cody Gray Mod
    Commented May 24, 2016 at 12:50

You must log in to answer this question.

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