Ruby Video
Talks
Speakers
Events
Topics
Leaderboard
Sign in
Talks
Speakers
Events
Topics
Use
Analytics
Sign in
Suggest modification to this talk
Title
Description
Title: DIY::Thread.profile -- Light-Weight Profiling in Pure Ruby Presented by: Jason Clark Whether your application is concurrent or not, there's insight to be gained from Ruby's threading support. This talk demonstrates building a light-weight sampling profiler in pure Ruby. The techniques are simple enough to integrate into almost any application, and fast enough for even a production environment. If you've ever wondered exactly what your application is doing at any given moment, this will show you how to find out. Along the way we'll expose gotchas and pitfalls of thread introspection on the many versions and implementations of Ruby. Based on experience implementing thread profiling for New Relic, we'll also touch on how to debug and work around problems when they come up Help us caption & translate this video! http://amara.org/v/FGbu/
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
In this presentation titled 'DIY::Thread.profile -- Light-Weight Profiling in Pure Ruby,' Jason Clark from New Relic discusses building a lightweight sampling profiler for Ruby applications, leveraging Ruby's thread APIs. The talk highlights the benefits of profiling both concurrent and non-concurrent applications, emphasizing that valuable insights can be derived without necessarily spawning multiple threads. **Key Points Discussed:** - **Methods of Profiling:** - Two major approaches: Instrumenting the application (e.g., using SetTraceFunc or RubyProf) and sampling. Instrumentation provides detailed timing but can slow down applications significantly, rendering it unsuitable for production. Sampling, however, offers statistical data and can run with minimal performance impact in production environments. - **Building a Sampling Profiler:** - The profiler utilizes the Thread class to create separate threads for sampling at specified intervals. Jason outlines how to spawn a thread, check its status, and capture backtraces to gather profiling data. - A simple hash structure is implemented to count occurrences of method calls as sampled during the application runtime, providing metrics without needing full instrumentation. - **Visualizing Profiler Data:** - After collecting profiling data, the presentation considers how to filter out noise and enhance visibility of the actual application code. Jason introduces an alternative representation via a call tree, allowing further insight into method call relationships and performance implications. - **Challenges and Gotchas:** - Sampling frequency needs careful consideration based on the application's traffic and operation types (I/O vs CPU-bound tasks). Challenges include overhead and potential data discrepancies when operating in various Ruby environments, especially with threading nuances in JRuby. - **Conclusion:** - A well-implemented sampling profiler can significantly enhance understanding of Ruby application behavior, assist in diagnosing performance bottlenecks, and support informed decisions on optimization. The talk concludes with Jason emphasizing the importance of this profiling approach and sharing resources like the GitHub code repository for further exploration. The presentation offers a comprehensive guide to integrating lightweight profiling techniques and encourages Ruby developers to consider these methods for better application performance tracking.
Suggest modifications
Cancel