A sampling call-stack profiler for Ruby 2.2+ that collects performance data with low overhead.
Stackprof is a sampling call-stack profiler for Ruby 2.2+ that collects performance data with minimal overhead. It helps developers identify CPU bottlenecks, wall-time issues, and object allocation patterns in their Ruby applications. The profiler supports multiple sampling modes and generates detailed reports including flamegraphs for visualization.
Ruby developers and performance engineers who need to diagnose and optimize performance issues in Ruby applications, particularly those running on Linux-based systems.
Developers choose Stackprof for its low-overhead sampling using modern Ruby C-APIs, multiple profiling modes, and detailed call graph aggregation that provides actionable insights into application performance bottlenecks.
a sampling call-stack profiler for ruby 2.2+
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Uses Ruby 2.1+ C-APIs like rb_profile_frames and rb_postponed_job_register_one to minimize profiling impact, as described in the Sampling section, ensuring accurate data with minimal performance penalty.
Supports CPU, wall time, object allocation, and custom sampling with tunable intervals, allowing targeted analysis of different performance aspects, as outlined in the Getting Started and Sampling sections.
Builds an incremental call graph from samples with weighted edges, showing method relationships and call frequencies, enabling deep insights into code interactions, as explained in the Aggregation section.
Generates text reports, dot graphs, source annotations, and flamegraphs, with built-in Rack middleware for web apps and raw data export, making it versatile for various analysis workflows.
Requires a Linux-based operating system per the README's Requirements, making it incompatible with macOS or Windows environments without workarounds, limiting its usability for cross-platform teams.
The README lists 'Todo' items like file/iseq blacklist and signal handler restoration, indicating missing functionalities that could affect stability or customization in production use.
Generating flamegraphs requires enabling the raw: true flag and using additional commands like --flamegraph-viewer, adding steps compared to profilers with integrated visualization tools.