Takeaways
It takes the same techniques we learned in Chapter 2, Fix Common Performance Problems to make your Rails application faster:
-
Optimize memory taken by ActiveRecord by aggressive preloading, selective attribute fetching, and data processing in batches.
-
Replace explicit iterators in views with render collection, which takes both less time and memory.
-
Let your database server do your data manipulation.
This and the two previous chapters contain all the advice I can give you to make your Ruby and Rails code faster. Go ahead, apply it, and reap your performance benefits. So why, you may ask, is this not the end of the book? Because any cookbook-style advice is only good for well-known situations. And it leaves you unprepared when performance ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access