Measure Performance

Learn how to measure and check the performance of our Rails application.

Developers modify code to perform better but have not taken the necessary steps to understand the current performance and demonstrate why the current level of performance is insufficient. This implies that we must measure performance before we can improve it.

Measuring the performance of our app can also help direct any conversation or complaint about the app being slow. This is because the cause of app slowness isn’t always what we think, and if we aren’t measuring every aspect of the app’s behavior, we may end up optimizing the wrong parts of the app without making it perform better. See thisMeasurePerformance for an example of how performance measurement can lead to the right area of focus.

We need to be careful not to over-measure at first because the code we must write to measure certain performance details has a carrying cost. For example, here is how we would measure the performance of an arbitrary block of code using Open Telemetry (which is standard for application performance monitoring supported by several vendors):

Get hands-on with 1400+ tech skills courses.