-
Book Overview & Buying
-
Table Of Contents
Polished Ruby Programming - Second Edition
By :
It's better to never guess where the slow parts of your code are, since you will often be incorrect. There is one way to know where the slow parts of your code are, and that is to profile your code. There are many good options for profiling Ruby code, from older profilers such as ruby-prof and stackprof, to newer profilers such as Vernier and rbspy.
ruby-prof is one of the oldest profiling libraries for Ruby. It is a tracing profiler, built on top of TracePoint (a Ruby core class), meaning that it keeps track of every single method call Ruby is making. The use of tracing means ruby-prof can provide the most accurate profiling. However, because of this, it's the slowest profiler, about two to three times slower than running standard Ruby. Often, that makes it unsuitable for profiling production applications.
stackprof, Vernier, and rbspy are sampling profilers, which means that instead of tracing method calls, they only check and see what method...
Change the font size
Change margin width
Change background colour