Chapter 3Make Rails Faster

In principle, you already know how to make Rails faster: the same performance optimization strategies that we’ve discussed in the previous chapter will work for any Rails application. Use less memory, avoid heavy function calls in iterators, and write less Ruby and Rails. These are the big things that make Rails applications faster, and you’ll learn how to apply them in this chapter.

But before we start, make sure you have at least a bare Rails application set up and running. All the examples you’ll see in this chapter require a Rails 4.x application with a database connection. I’ll also assume we are both using a PostgreSQL 9.x database. PostgreSQL is my preferred choice not only because it is one of the best-performing ...

Get Ruby Performance Optimization now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.