Talks
Speakers
Events
Topics
Sign in
Home
Talks
Speakers
Events
Topics
Leaderboard
Use
Analytics
Sign in
Suggest modification to this talk
Title
Description
As you grow your Rails app, is it starting to slow down? Let’s talk about how to identify slow code, speed it up, and verify positive change within your application. In this talk, you’ll learn about rack-mini-profiler, benchmark/ips, and performance optimization best practices.
Date
Summarized using AI?
If this talk's summary was generated by AI, please check this box. A "Summarized using AI" badge will be displayed in the summary tab to indicate that the summary was generated using AI.
Show "Summarized using AI" badge on summary page
Summary
Markdown supported
### Profiling to Make Your Rails App Faster In this presentation, Gannon McGibbon discusses methods for improving the performance of Rails applications through profiling. As a Rails committer and a member of Shopify's code foundations team, McGibbon brings a wealth of experience to the topic, especially from working on one of the largest Rails applications in the world. The talk is structured around a scenario where a new developer inherits a slow Rails app and seeks to understand and resolve performance issues. #### Key Points: - **Introduction to Profiling**: McGibbon emphasizes the importance of profiling over generic performance optimizing strategies. He introduces tools like rack-mini-profiler, memory_profiler, and stack_prof, explaining their roles in identifying performance bottlenecks in Rails applications. - **Understanding Profiling Tools**: - **rack-mini-profiler**: A middleware that displays a speed badge and provides insights into the timing of page loads and SQL query performance. - **Memory Profiler**: It provides detailed reports on memory allocations, showing both allocated and retained memory. - **Stack Prof**: This helps analyze call stacks to identify where time is being spent in the application. - **Practical Application**: McGibbon illustrates how to apply these tools with a narrative where the developer has to improve a slow checkout process. It highlights: - Moving to background jobs for payment processing to reduce wait times. - Implementing caching mechanisms to speed up the product pages. - **Profiling in Production**: McGibbon explains how profiling can also be executed in production environments using rack-mini-profiler with authorization strategies to track performance issues without affecting end-users. - **Benchmarking Methods**: To measure the performance impacts of code changes, McGibbon introduces the Benchmark IPS gem, demonstrating how it compares performance before and after implemented optimizations. #### Examples and Case Studies: - McGibbon recounts how projects at Shopify revealed significant speed regressions due to previous rushed development, necessitating focused profiling efforts to identify potential pitfalls. - Specific issues discussed include optimizing N+1 query problems in cart item loading and slowing app boot times due to improper loading practices. #### Conclusions and Takeaways: - Utilize profiling and benchmarking as fundamental practices for maintaining performance in Rails apps. - Focus on practical application of tools to derive impactful change rather than adhering strictly to best practices that may not address specific issues. - The importance of caching and background jobs in improving app responsiveness and user experience. In summary, McGibbon’s talk stresses bridging the gap between code optimization theories and practical applications, empowering developers to enhance Rails app performance systematically. The affiliated GitHub repository contains additional resources for further learning and experimentation.
Suggest modifications
Cancel