63

I'm working on a project. I have identified a low-performing critical path in the code base and have managed to optimize it quite successfully.

However, I have this nagging feeling that the code can be optimized further. Is it okay to ask help in optimizing the code further?

Return to FAQ index

2
  • 10
    The question and answer are great, and should be the canonical question we point people to when they ask about optimization questions.
    – user1228
    Commented Feb 20, 2015 at 16:41
  • see also: Performance question - Stack Overflow or Code Review?
    – gnat
    Commented Jan 13, 2016 at 7:22

1 Answer 1

80

Before you post your question, consider what it is you're asking.

If you've actually profiled the code, have specific snippets so that everyone can run the same code to see its performance, and you have this library publicly published somewhere, like GitHub, Bitbucket, or another public facing code repository, then asking it on Code Review is acceptable.

If you're just starting the code but have profiled an exact snippet that exhibits the aberrant performance, then asking it on Stack Overflow is acceptable.

Per the above, including the results from your profiler of choice with identified bottlenecks would go a long way towards keeping it on topic on either site.

However, if you're looking for someone to help you optimize the code without having done any of the due diligence mentioned prior, reconsider posting your question. It is important that you demonstrate why you believe that your piece of code is not performant, as well as provide as much evidence as you can to back it up.

0

You must log in to answer this question.

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