Speeding Up Your Ruby on Rails App

Indexing, threading, compression, eager loading, lazy loading, pagination, Turbolinks and more.

Daniel Lempesis
14 min readFeb 23, 2019

Note: This guide was written with Rails 5+ running on Puma in mind, but the basic ideas should extend to other versions of Rails and even other non-Ruby frameworks.

Preface

There are a wide variety of tools which can help you spot and monitor performance issues, ranging from free to expensive, easy to use to less-easy to use. I would be remiss, however, if I didn’t direct your attention to the easiest and freest of all: the Lighthouse tool built straight into Google Chrome.

Yes, it’s possible Google might bring about the end of the world, but in the meantime they offer really handy tools for highlighting areas for improvement. Running the Lighthouse tool will give you feedback on things like how long it takes for your page to display meaningful information and become interactive. If it finds areas it thinks should be improved, it will display helpful messages with suggestions on what to do.

So drop into your Chrome dev tools (command + option + i), hit the Lighthouse tab and run it on your website’s problem pages. You can even empty your storage and emulate a 3G phone with a slower CPU to simulate a mobile device hitting…

--

--