tmm1/stackprof
56.7
Adequate · 6 November 2026
894
lines of production code
Ruby
with C, JavaScript
4
measurements over time
What this system is
Stackprof is a Ruby profiling library that captures CPU, wall-clock, and object allocation data to help developers analyze application performance. It provides a command-line interface and Rack middleware for easy integration, supporting multiple output formats including JSON and Callgrind. The system generates interactive flamegraph visualizations and call graphs to help users identify bottlenecks and optimize code.
Features
Added vendor libraries for profiling visualization
Integrated the gprof2dot and FlameGraph vendor libraries to enable the generation of call-graph visualizations from profiler output. The gprof2dot component (gprof2dot.py, hotshotmain.py) converts profiler data into DOT graphs, while the FlameGraph component (flamegraph.pl, README) provides scripts to render flame graphs from folded stack samples, supporting tools like DTrace, perf, and SystemTap.
vendor · high confidence
Introduce stackprof CLI with extensive profiling and visualization options
The \bin/stackprof\ executable is introduced, providing a command-line interface for running Ruby profilers and analyzing dump files. Users can now profile applications directly via \stackprof run\ with configurable modes (cpu, wall, object), intervals, and output targets. For existing \.dump\ files, the tool supports a wide range of output formats including text summaries, JSON, Callgrind, Graphviz, and various flamegraph styles (timeline, alphabetical, d3-flamegraph). It also includes features for filtering by method or file, interactive stack walking, and combining multiple profiles.
bin · high confidence
New autorun mode, Rack middleware, and TruffleRuby stubs
StackProf now supports automatic profiling via environment variables (STACKPROF\_MODE, STACKPROF\_INTERVAL, etc.) through a new autorun.rb entry point, allowing users to enable profiling without code changes. A new Rack middleware (lib/stackprof/middleware.rb) enables per-request profiling with configurable save intervals, output paths, and conditional enabling. Additionally, a TruffleRuby stub (lib/stackprof/truffleruby.rb) is added to provide graceful error messages directing users to GraalVM's built-in profilers, improving compatibility awareness.
lib/stackprof · high confidence
New canvas-based flamegraph viewer with drag-to-select and zoom
The flamegraph visualization has been rewritten to use an HTML5 canvas instead of the previous DOM-based approach, resulting in improved scrolling and zooming performance, particularly in Firefox. Users can now interact with the overview bar by dragging the viewport overlay to navigate the profile, and mouse wheel gestures allow for zooming in and out. The viewer also includes a legend panel and detailed frame information display.
lib/stackprof/flamegraph · high confidence
Removals
Removal of C extension source files
The C extension implementation files \ext/extconf.rb\ and \ext/stackprof.c\ have been deleted from the repository. This removes the native C code responsible for the sampling call-stack profiler functionality on MRI, meaning the library can no longer be built or used as a native extension.
ext · high confidence
Behavioural changes
Added TruffleRuby support and YJIT-specific job handling
StackProf now supports installation on TruffleRuby by loading the appropriate engine-specific implementation. Additionally, the library now conditionally uses postponed jobs to address stability issues: it enables them for Ruby 3.2.0 to avoid crashes related to signal timing, and for Ruby versions prior to 3.3 when YJIT is enabled, while skipping this for Ruby 3.3+ where the underlying Ruby issue is resolved.
lib · high confidence
Stackprof 0.2.25 release with GC marking fix and flamegraph updates
This release (0.2.25) includes a fix for GC marking to prevent metadata from being garbage collected prematurely, updates the flamegraph.pl tool to the latest version, and adds an option to ignore GC frames in profiles. It also handles cases where source code is unavailable, freezes strings in the report module, and uses a cursor object instead of array slicing for better performance. The default sampling mode is now :wall, and the tool supports custom sampling modes and metadata options. Documentation has been updated to reflect these changes, including new examples for flamegraph generation and viewer usage.
(repo-wide) · high confidence
Stackprof extension rewritten for modern Ruby APIs and GC profiling
The C extension in ext/stackprof has been completely rewritten to support Ruby 2.1+ and modern Ruby internals. It now uses the TypedData API, postponed jobs for safer signal handling, and monotonic clocks for accurate timestamps. A key behavioral change is the ability to record and ignore garbage collection frames (via the new ignore\_gc option), allowing users to profile application code without GC noise. The extension also adds support for TruffleRuby and ensures compatibility with YJIT.
ext/stackprof · high confidence
Test coverage
Added tests for middleware, report I/O, and TruffleRuby compatibility
Added test coverage for the StackProf middleware (including custom paths, Proc-based enabling, raw mode, and metadata), report serialization/deserialization (reading JSON and Marshal dump files, printing to STDOUT and files), and TruffleRuby-specific error handling. Updated the main test suite to use Minitest, added tests for the new raw sampling mode with timestamps, and adjusted assertions for Ruby version compatibility.
test · high confidence
Dependencies
stackprof gem updated to v0.2.27 with Ruby 2.2+ requirement and new CLI tools
The stackprof gem has been upgraded from version 0.1.0 to 0.2.27, raising the minimum supported Ruby version from 2.1 to 2.2. This release introduces new command-line executables (stackprof, stackprof-flamegraph.pl, and stackprof-gprof2dot.py) and updates development dependencies to include minitest (\~\> 5.0) and rake-compiler (\~\> 0.9). Additionally, the gem now includes metadata links for bug tracking, documentation, and source code, and the extension source files have been moved to the ext/stackprof directory.
(dependencies) · high confidence
Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
Score
- CAI 57 → 57 (-0.1)
- Rubric changed (rubric-2026.10.5 → rubric-2026.11.2) — scores are not directly comparable.
Lenses
- Code Health 71 → 71 (+0.0)
- Architecture 67 → 67 (+0.0)
- Maturity 43 → 43 (+0.0)
- Readiness 65 → 65 (+0.0)
- Security 98 → 97 (-1.3)
Resolved (3)
- Ambiguous duplication of intent. Both methods accept arguments and likely initiate the profiling process. It is unclear if 'run' is a convenience wrapper for 'start' or if they serve distinct lifecycle states (e.g., one-shot vs. long-running).
- Documentation: no architecture or design documentation
- Redundant factory methods. Both methods appear to construct a Report instance from a JSON string. Having two public entry points for the same deserialization logic creates confusion for API consumers.
Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
tmm1/stackprof was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 6 November 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit 804add8350705e33a1e4a671e0ad9ce5e304d8f3 — the exact code this score is about.
- Scored under rubric-2026.11.2 — the same rubric and the same method as every other entry in this index.
- Measured by Canine Code Analyzer (cca.canine.dev) using cca measure-2026.11.2+preprod-5c4e66d9318b.