Benchmarking Ruby on Rails End-to-End Page Performance
There’s a lot of information available about ways to improve performance in Ruby on Rails applications. I’ve even written about it myself. But one thing that’s often skipped over is exactly how you are supposed to benchmark your performance improvements, particularly if you want to do a full end-to-end speed comparison.
Benchmarking vs Profiling
A quick refresher; to profile code (in performance terms) is to figure out which parts of the code are causing a slowdown. This is how you figure out which part of your code needs attention - is it the view, application, or database layer? The rack-mini-profiler gem is a nice way to add some of this to a Rails application, and you can configure it to produce flamegraphs as well for more detailed analysis.