I posted the following question on Stack Overflow:

Efficient Intersection and Union of Lists of Strings

There is disagreement as to whether it is on- or off-topic. The concern is that my code already "works", although I need to find a more efficient approach since I need to run it in a huge loop.

Should this question be moved to Code Review as some suggest, or is there anything I can do to improve the question to allow it to be on-topic for Stack Overflow?

  • Can a user migrate her own question (complete with existing comments and answers) to a different site? Jan 7, 2014 at 17:06
  • No, they cannot.
    – Servy
    Jan 7, 2014 at 17:06
  • 1
    I believe that the question is appropriate for SO. I vote to re-open the question. Jan 7, 2014 at 17:09
  • 4
    I dislike the growing trend of closing stuff like this, especially when there is no automatic migration. I bet most users suggesting code review have never actually set foot on that site. But then, a question asking for more efficient ways is definitely at odds with SO's guidelines these days, and is in danger for being closed as "too broad" even if we vote to reopen it.
    – Pekka
    Jan 7, 2014 at 17:12
  • Also since I don't have 3K reputation, is there any way to see how many re-open votes a question of mine has? Jan 7, 2014 at 17:15
  • @PurpleVermont That's a privilege that, if I remember right, is rewarded at 250 rep.
    – Blaze
    Jan 7, 2014 at 17:17
  • 1
    @Pekka in the case of somewhat off-topic but high quality questions it would indeed be nice if people tried to migrate (by flagging) without closing (unless its one of the migration path closures) Jan 7, 2014 at 17:23
  • for what it's worth, the post I liked (as well as many others) seems to provide precedent for code efficiency / performance questions to be asked on SO -- have the standards changed? Jan 7, 2014 at 17:31
  • that should say linked above (not liked). Too late to edit. Jan 7, 2014 at 18:50

3 Answers 3


This is the sort of question I personally find really useful; optimizing common algorithms for uncommon data sets can be a very tedious... And often just doesn't get done because unless someone's already done the leg-work it's too much of an investment. So I love seeing them on SO.

That said, you have a small problem with your question as it stands:

The accepted answer here Efficiently compute Intersection of two Sets in Java? looked extremely helpful but (likely because my sets are small (?)) I haven't gotten much improvement by using the approach suggested in the accepted answer.

Give us some more information on your sets. How small? How many of them? If someone's looking to optimize for a situation wholly different from what's been considered in the previous question, it's important that they have a good understanding of the nature of that situation! Ideally, folks would be able to test their solutions against data of a certain form (if not necessarily specific data).

Do that, and I think it'd be a perfectly good question.

  • Done, and thank you for the suggestions. Jan 7, 2014 at 17:49

Leaving aside the possible improvements to your question that Shog9 described, the question absolutely should not have been closed on the basis that it would also be on-topic on Code Review. There was already another case of this "it's on topic on Code Review, so it's off topic on Stack Overflow" reasoning in this Meta question, and it was flatly contradicted by moderator Bill the Lizard♦, to near-unanimous agreement by the community - at the time that I write this, his answer is currently on (+18/-1) score.


IMO, your question as it stands now is more on-topic at CR - especially considering this sentence:

My question is, is there anything I can do to improve this, given that I'm working with Strings which may be more time consuming to check equality than other data types.

  • What would be involved in getting it migrated over there? It seems like migrating would be better than just duplicating it. Jan 7, 2014 at 17:28
  • Also, why does SO have tags for code-efficiency and performance if those are off-topic for SO? Jan 7, 2014 at 17:31

You must log in to answer this question.

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