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

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 ...

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