Skip to content
CAI
Software that uses CAICheck a score

tmm1/stackprof

63.2

Adequate · 19 September 2026

894

lines of production code

Ruby

with C, JavaScript

1

measurement over time

CAI band scale
CAI lens gauges

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 watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

Baseline

  • First survey — no prior run to compare against. CAI 63.

Lenses

  • Code Health 100
  • Architecture 69
  • Maturity 53
  • Readiness 62
  • Security 98

Changes since last survey

  • 300 commits — 254 feature/other, 46 fixes

By area

  • (repo) — 109 commits
  • (root) — 58 commits
  • ext/stackprof — 46 commits
  • lib/stackprof — 42 commits
  • test/test_stackprof.rb — 16 commits
  • bin/stackprof — 9 commits
  • .github/workflows — 5 commits
  • ext/stackprof.c — 5 commits
  • test/test_middleware.rb — 5 commits
  • lib/stackprof.rb — 3 commits
  • test/fixtures — 1 commit
  • vendor/FlameGraph — 1 commit

Notable commits

  • fix: Don't measure text, just assume fixed-width characters
  • fix: Fix #37: add filters in text reports.
  • fix: Fix FrozenError on stackprof --graphviz
  • fix: Fix GC profiling timing
  • fix: Fix a compilation error and a compilation warning
  • fix: Fix buffer overflow in stackprof_record_sample()
  • fix: Fix compatibility with newer minitest
  • fix: Fix data race in GC frame recording between signal handler and postponed job
  • fix: Fix deprecation warning in report.rb
  • fix: Fix filtering for Graphviz report
  • fix: Fix infinite realloc loop when rb_profile_frames returns 0
  • fix: Fix mixed declarations and code warnings on Ruby <= 2.6
  • fix: Fix modeline
  • fix: Fix printing CLI banner
  • fix: Fix sample.rb
  • fix: Fix the test suite for Ruby 3.0
  • fix: Fix these warnings
  • fix: Fix timestamp delta calculations
  • fix: Fix timestamp math for platforms with _POSIX_MONOTONIC_CLOCK
  • fix: Fix timestamp math for platforms without _POSIX_MONOTONIC_CLOCK
  • …and 280 more

Written by watchdog.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 19 September 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.09.15 — the same rubric and the same method as every other entry in this index.
  • Measured by watchdog.canine.dev using codehealth-analyzer preprod-13a154b7f5d1.