O'Reilly logo

Ruby Performance Optimization by Alexander Dymo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 4Profile

All right, so you’ve learned the key performance optimization techniques and can apply them to your code. But what do you do when none of the techniques we’ve discussed work?

You profile.

Profiling is the only sure way to answer the question “What is slowing this code down?” Profiling can be hard and time consuming, but there’s really no shortcut. If you can’t optimize just by looking at the code or by taking an educated guess, you have to profile.

Once you know exactly what is slowing you down, fixing it becomes trivial. So now I’ll teach you the arcane secrets of profiling, which will make finding out what’s slow easier.

Let’s start our exploration of profiling by breaking it down into its two basic parts. First, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required