Takeaways

Testing is the best way to maintain application performance after optimization. Let’s summarize what it takes to do that.

  1. Write performance tests—special kinds of integration tests that benchmark your code, keep results, and then assert performance by comparing current and previous benchmarks.

  2. Make sure your performance tests get the measurements and comparisons right. Use the framework we wrote in this chapter to create your own performance tests.

  3. When performance testing Rails, don’t forget about database performance. Make sure you create enough data for performance tests, and check how many queries your requests run.

Congratulations! Now you know everything you need to know to optimize your Ruby code, measure optimization ...

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.