When is performance gain significant enough to implement that optimization?

Posted by Zwei steinen on Stack Overflow See other posts from Stack Overflow or by Zwei steinen
Published on 2010-03-23T00:37:21Z Indexed on 2010/03/23 0:41 UTC
Read the original article Hit count: 359

Hi, following the text book, I do measure performance whenever I try optimizing my code. Sometimes, however, the performance gain is rather small and I can't decisively decide whether I should implement that optimization.

For example, when a fix shortens an average response time of 100ms to 90ms under some conditions, should I implement that fix? What if it shortens 200ms to 190ms? How many condition should I try before I can conclude that it will be beneficial overall?

I guess it's not possible to give a straight forward answer to this, as it depends on too many things, but is there a good rule of thumb that I should follow? Are there any guideline/best-practices?

© Stack Overflow or respective owner

Related posts about language-agnostic

Related posts about Performance