We saw in this chapter that there are only three things that you need to consider to make your Ruby code faster:
Optimize memory by avoiding extra allocations and memory leaks.
Write faster iterators that take both less time and memory.
And finally, write less Ruby code by letting specialized tools do their job.
The beauty of these techniques is that you can apply them to any Ruby program to make it up to ten times faster. But the majority of the Ruby developers are writing Rails applications, so it’s now time to dive deeper and apply our optimization techniques to Ruby on Rails.