Takeaways

There’s only one way to prove that the optimization worked. You measure the performance before and after, and you compare. But the devil is in the details. Here’s what you need to take care of to get the measurements right.

  1. Minimize external factors to increase measurement accuracy.

  2. Make sure that GC behaves as predictably as possible to decrease variability in measurements.

  3. Take as many measurements as practical to make statistical analysis possible. A good default is 30.

  4. Compare before and after numbers by calculating the confidence interval of the optimization effect. Conclude that optimization worked only when the lower bound of the confidence interval is higher than 0.

  5. Try to reduce dispersion in measurements as much ...

Get Ruby Performance Optimization now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.