RailsConf 2023 - Rails Performance Monitoring 101: A Primer for Junior Developers by Rishi Jain

Learn the fundamentals of Rails performance monitoring in this beginner-friendly talk by Rishi Jain at RailsConf 2023. Discover essential techniques to optimize your Rails application's performance and ensure a smooth user experience.

Key takeaways
  • Use modern image formats. WebP and AVIF have superior compression and quality characteristics compared to traditional formats like JPEG and PNG.

  • Reduce unused CSS. Unused CSS can significantly slow down page load times. Use tools like PurifyCSS or UnCSS to identify and remove unused CSS.

  • Defer non-critical CSS and JavaScript. Deferring non-critical CSS and JavaScript can improve the perceived performance of your website by loading the most important content first.

  • Use a CDN. A CDN can help to improve the performance of your website by caching static content and serving it from a location closer to your users.

  • Minify and compress your assets. Minifying and compressing your CSS, JavaScript, and images can reduce their size and improve load times.

  • Use a performance monitoring tool. A performance monitoring tool can help you to identify performance bottlenecks in your website and track your progress over time.

  • Use background jobs for long-running tasks. Long-running tasks can slow down your website if they are run on the main thread. Use background jobs to run these tasks asynchronously.

  • Avoid N+1 queries. N+1 queries are a common performance problem in Rails applications. They occur when you make multiple database queries to fetch data that could be fetched in a single query.

  • Use indexes wisely. Indexes can help to improve the performance of your database queries. However, it is important to use indexes wisely, as they can also slow down your database if they are not used correctly.

  • Cache your data. Caching can help to improve the performance of your website by reducing the number of times that your application needs to fetch data from the database.