Diagnosing a slow Rails page, layer by layer (opens in new tab)
"This page feels slow" is a vague bug report. Before changing any code, it helps to have a fixed way to locate where the time goes. A Rails request passes through a few predictable layers, and each layer has its own tools and its own typical failure mode. Here is the mental model I use, and a real example of walking it end to end. The layers of a request Middleware → Controller → SQL → View → external calls → browser Most slowness lives in one of these: Layer Typical problem How it shows up C...
Read the original article