Benchmarks

-79.7%

Mean token savings across read, grep, and edit — measured against ashlrai/ashlr-plugin, commit 364a403, on October 19, 2026.

files measured
1,294
lines of code
277,392
read samples
16
grep patterns
5

Per-tool breakdown

ashlr__read

mean-79.4%p50-79.5%p90-52.9%
dark bar = mean  ·  mid = p50  ·  light = p90

ashlr__grep

mean-91.3%p50-95.8%p90-76.1%
dark bar = mean  ·  mid = p50  ·  light = p90

ashlr__edit

mean-62.4%p50-88.2%p90-0.0%
dark bar = mean  ·  mid = p50  ·  light = p90

ashlr__edit “small” scenario (15-char change) shows ratio > 1 by design: the diff header is longer than the trivial before/after for tiny changes. Medium and large edits compress well. This is reported honestly.

Read sample scatter

ashlr__read: file size vs. reduction

0%25%50%75%100%1.3 MB2.7 MB4.0 MB5.4 MBfile sizetokens saved-57.3%-32.4%-64.2%-52.9%-77.7%-70.4%-79.5%-77.2%-93.7%-89.8%-93.1%-89.8%-97.4%-97.2%-99.9%-97.3%

Each dot is one sampled file. x-axis = raw file size; y-axis = tokens saved. Files below 2 KB are excluded (snipCompact only fires above that threshold).

Methodology

Measurement methodology (version 2): **ashlr__read**: For each sampled source file, we measure raw file bytes and token count (chars/4 heuristic). We then apply the same snipCompact transformation used at runtime — wrapping the content in a tool_result message and calling snipCompact() — and measure the resulting byte/token count. The ratio is ashlrTokens / rawTokens. Files below 2 KB are excluded because snipCompact only fires on tool results > 2 000 chars; savings are zero by design for small files. Files are selected deterministically: the repo HEAD commit SHA is folded into a 32-bit seed (mulberry32 PRNG), then up to 4 files are sampled from each of four size buckets (2–5 KB, 5–15 KB, 15–50 KB, 50+ KB). Re-running on the same commit always picks the same files. **ashlr__grep**: Five common patterns (function, import, TODO, class, interface) are run via plain `rg -n` (path:line:text, the shape a native grep returns) against the repo root; that output is the raw size. The ashlr__grep fallback path (no genome) caps lines at 300 columns and, above 4 000 chars, keeps whole lines from the head and tail. The ratio is ashlr/raw. Note: when a .ashlrcode/genome/ index is present, real-world grep savings are substantially higher. This benchmark measures only the conservative no-genome baseline. **ashlr__edit**: Three synthetic edits (small ~15 chars, medium ~300 chars, large ~3 000 chars) compare the naive "ship before+after as text" approach against ashlr__edit's diff-summary format (one header line + removed/added first-lines). The ratio is summary tokens / naive tokens. **Aggregation**: per-tool mean/p50/p90 are computed over each tool's ratio values (lower ratio = more savings). The `overall.mean` is pooled across every individual sample regardless of tool — so tools with more samples (read has 15, grep has 5, edit has 3) weight the overall figure proportionally. That makes the headline number reflect the workload mix, not a uniform per-tool average. The unweighted mean of per-tool means is intentionally NOT published because it gives equal weight to a 3-sample tool and a 15-sample tool, which over-weights the synthetic edit overhead. Token counts use the chars/4 heuristic, the same estimator the plugin uses at runtime for savings accounting.

Reproduce it yourself

Run the benchmark against any git repo you have locally:

# against the plugin itself (dogfood)
bun run scripts/run-benchmark.ts --repo .

# against any other repo
bun run scripts/run-benchmark.ts --repo /path/to/repo --out /tmp/results.json

# dry-run (no file written — useful for CI checks)
bun run scripts/run-benchmark.ts --dry-run

Requires: bun, git, ripgrep (rg). Same commit SHA always picks the same files.

Raw data

The full JSON result file — every sample, every ratio, the exact methodology string.

Download benchmarks-v2.json