ContextZip Benchmark Results

March 19, 2026 ยท View on GitHub

Date: 2026-03-19 Version: 0.1.0 (based on rtk 0.30.1) Test cases: 102 Methodology: Each test uses realistic, production-like input data. Character count is used as a proxy for tokens. All tests run with CONTEXTZIP_QUIET=1.

Summary

CategoryCasesAvg Input (chars)Avg Output (chars)Avg Savings
Error Stacktraces201,70671658.7%
Web Pages154,3002,38842.5%
ANSI/Spinners151,82736082.5%
Build Errors153,8021,33655.6%
Package Install153,1512,50939.2%
Docker Build101,40516588.2%
CLI Commands126,8451,00642.0%
Overall1023,2011,24457.4%

Weighted overall savings (by total chars): 61.1% (326,556 chars in, 126,969 chars out)

Key Findings

  1. Best performers: Go error stacktraces (94-97%), Docker build logs (77-97%), pip install (90-99%), ANSI spinner/progress removal (95-98%)
  2. Solid performers: Node.js/Python error stacktraces (65-92%), Cargo build errors (71-90%), heavy navigation web pages (61%)
  3. Moderate performers: TypeScript tsc errors (37-81%), web page extraction (5-64%), git commands (51-78%)
  4. Weak performers: npm deprecation warnings via npm filter (2-8%), ESLint small inputs (2-10%), Rust panic stacktraces (2-7%)
  5. Negative savings (output > input): Java IOException (-12%), ESLint 10 violations (-10%), ls src/ (-56% due to metadata enrichment)

Detailed Results

Error Stacktraces (20 cases, avg 58.7% savings)

#SubcategoryDescriptionInput (chars)Output (chars)Savings
1Node.jsTypeError with 30 express frames2,25517992.1%
2Node.jsReferenceError with 15 async frames1,26923681.5%
3Node.jsSyntaxError with 10 node internal frames81228165.4%
4Node.jsECONNREFUSED with 30 frames2,46649480.0%
5PythonValueError with 22 FastAPI frames3,09733389.3%
6PythonKeyError with 12 Django frames1,56717389.0%
7PythonImportError with 20 bootstrap frames2,20117592.1%
8PythonAttributeError with 12 Flask frames1,60931180.7%
9RustIndex out of bounds panic 20 frames2,7092,6402.6%
10RustUnwrap on None panic 10 frames1,3371,3131.8%
11RustThread panic 5 workers + 10 frames1,4241,3326.5%
12RustCustom panic with 7 frames9979742.4%
13GoNil pointer goroutine crash 25 frames1,7244897.3%
14GoIndex out of range 3 goroutines9395993.8%
15GoDeadlock 6 goroutines8015293.6%
16GoChannel close panic 4 goroutines5373094.5%
17JavaNullPointerException 30 Spring frames3,0491,34056.1%
18JavaClassCastException 20 frames2,0151,28836.1%
19JavaIOException 21 HttpClient frames1,8122,032-12.1%
20JavaCustom exception with Caused by chain1,5031,04130.8%

Web Pages (15 cases, avg 42.5% savings)

#SubcategoryDescriptionInput (chars)Output (chars)Savings
21DocumentationSupabase-like auth docs with nav/sidebar/footer5,3163,31937.6%
22DocumentationMDN-like Array.map reference5,3043,65731.1%
23DocumentationStripe-like PaymentIntent API docs3,6192,98317.6%
24DocumentationNext.js-like routing docs3,7322,65428.9%
25DocumentationRust book-like ownership chapter3,5091,40759.9%
26BlogMedium-like blog post with sidebars/CTAs4,8294,18613.3%
27BlogDev.to-like Rust tutorial post3,8392,62631.6%
28BlogPersonal blog with newsletter/share buttons2,4452,3225.0%
29API ReferenceREST API users endpoint docs2,4141,03057.3%
30API ReferenceGraphQL schema User type docs2,29582564.1%
31API ReferencePython SDK reference with code examples1,9001,01646.5%
32Heavy NavigationPage with 30+ nav items mega-footer (#32)6,3252,44961.3%
33Heavy NavigationPage with 30+ nav items mega-footer (#33)6,3252,44961.3%
34Heavy NavigationPage with 30+ nav items mega-footer (#34)6,3252,44961.3%
35Heavy NavigationPage with 30+ nav items mega-footer (#35)6,3252,44961.3%

ANSI/Spinners (15 cases, avg 82.5% savings)

#SubcategoryDescriptionInput (chars)Output (chars)Savings
36ANSI ColorsGit diff colored output (35 lines)2,3402,3400.0%
37ANSI ColorsJest test results with 2 failures (25 tests)1,75012692.8%
38ANSI ColorsESLint colored output 16 problems2,0561,78313.3%
39ANSI ColorsCargo build colored with 2 errors1,98126686.6%
40ANSI Colorsnpm install with 10 deprecation warnings1,9184897.5%
41Spinners/Progressnpm install with 20 spinner lines1,6494897.1%
42Spinners/ProgressCargo build 30 crate compilations1,2284896.1%
43Spinners/ProgressDocker pull with download progress1,1084895.7%
44Spinners/Progresspip install with progress bars and satisfied deps2,7244898.3%
45Spinners/ProgressWebpack bundling with progress percentages1,3194896.4%
46DecorationsPrisma-like ASCII art banner with box drawing2,8894898.4%
47DecorationsTest results with dividers and decorations1,68141175.6%
48Decorationscreate-next-app with box drawing and prompts1,6204897.1%
49DecorationsBuild output with stars/dashes/equals9254894.9%
50DecorationsDeployment status with heavy box drawing2,2294897.9%

Build Errors (15 cases, avg 55.6% savings)

#SubcategoryDescriptionInput (chars)Output (chars)Savings
51TypeScript tsc5 TS errors across 4 files65141336.6%
52TypeScript tsc10 TS errors across 5 files1,21557952.4%
53TypeScript tsc20 TS2322 errors in 20 files2,93855581.2%
54TypeScript tsc40 mixed TS errors in 40 files5,0172,10658.1%
55TypeScript tsc100 TS errors in 100 files14,1306,81851.8%
56ESLint5 ESLint violations5855702.6%
57ESLint10 ESLint violations9691,065-9.9%
58ESLint20 ESLint violations in 5 files2,2262,0269.0%
59ESLint50 ESLint violations in 10 files3,9011,60359.0%
60ESLint100 ESLint violations in 20 files10,2712,03280.3%
61Cargo3 Rust compiler errors91420277.9%
62Cargo5 Rust E0308 errors1,39913990.1%
63Cargo10 mixed Rust errors1,67249170.7%
64Cargo20 Rust E0308 errors4,48654088.0%
65Cargo50 Rust errors6,66590186.5%

Package Install (15 cases, avg 39.2% savings)

#SubcategoryDescriptionInput (chars)Output (chars)Savings
66npmnpm install with 10 deprecated warnings1,1961,1037.8%
67npmnpm install with 50 deprecated + vulns9,1448,9642.0%
68npmnpm install with 100 deprecated + 12 vulns9,1348,9761.8%
69npmnpm install clean (no warnings)1164858.7%
70npmnpm install with 5 deprecated + 8 vulns76941945.6%
71pippip install short (2 packages; 5 already satisfied)8274894.2%
72pippip install long (3 packages; 30 already satisfied)3,6914898.7%
73pippip install with deprecation/security warnings2,28222790.1%
74yarnyarn install with 10 warnings1,3181,11415.5%
75pnpmpnpm install with progress + 10 deprecated1,13737766.9%
76cargocargo install with compile progress9344894.9%
77npmnpm install with 50 deprecated warnings3,2163,1232.9%
78npmnpm install with 60 deprecated warnings3,8463,7532.5%
79npmnpm install with 70 deprecated warnings4,5174,3833.0%
80npmnpm install with 80 deprecated warnings5,1475,0132.7%

Docker Build (10 cases, avg 88.2% savings)

#SubcategoryDescriptionInput (chars)Output (chars)Savings
81Success5 steps mostly cached6564892.7%
82Success10 steps with pnpm build1,5014896.9%
83Success15 steps multi-stage build1,5944897.0%
84Success20 steps long build1,9004897.5%
85SuccessLegacy builder with npm warnings + next build1,46823384.2%
86FailureFail at step 4/5 (pnpm version mismatch)1,24224980.0%
87FailureFail at step 7/12 (TypeScript build error)1,67936978.1%
88FailureFail at step 16/20 (missing env var)1,43726581.6%
89Composedocker compose up with 5 services1,2604896.2%
90Composedocker compose up failure (missing module)1,31829677.6%

CLI Commands (12 cases, avg 42.0% savings)

#SubcategoryDescriptionInput (chars)Output (chars)Savings
91Realgit log --oneline -201,2621,2620.0%
92Realgit diff HEAD~11,3461,06720.8%
93Realls src/8661,352-56.1%
94Realls -la (project root)2,17459372.8%
95Realfind src/ -name *.rs1,36864153.2%
97Realcargo test -- --list60,23429199.6%
98Realgit status1004951.0%
99Realgit log --stat -52,99966178.0%
100Realgrep -r fn src/ (first 50 lines)3,1483,1480.0%
101Realgit log -10 (full format)3,8701,62758.0%
102Realcargo check723255.6%
103Realls -la src/4,7071,35271.3%

Notes

Measurement Methodology

  • Error Stacktraces (1-20): Realistic stacktraces piped through contextzip err cat <file>
  • Web Pages (21-35): HTML files processed by extract_content() function (tested via cargo test)
  • ANSI/Spinners (36-50): ANSI-laden output piped through contextzip err cat <file>
  • Build Errors (51-65): Realistic compiler output through contextzip tsc/lint/cargo cat <file>
  • Package Install (66-80): Install logs through contextzip npm/pip/pnpm cat <file>
  • Docker Build (81-90): Docker build output through contextzip docker cat <file>
  • CLI Commands (91-103): Real commands run in the contextzip repository

Why Some Cases Show Low/Negative Savings

  • err filter catches all as success: When contextzip err runs a command that exits 0, it outputs [ok] Command completed successfully (no errors) -- a 48-char summary. This is great for noisy success output but shows low savings for already-concise error messages.
  • npm deprecation warnings: The npm filter passes through warnings rather than stripping them, since deprecation info can be useful.
  • Rust panics: The err filter doesn't specifically parse Rust panic format, so it treats panic output as normal output.
  • ls enrichment: contextzip ls adds file count, sizes, and directory structure info that can exceed raw ls output for small directories.
  • Java IOException: The err filter added formatting overhead that exceeded the original for this particular case.
  • ESLint small inputs: With fewer than 10 violations, the filter's grouping headers add overhead.

Honest Assessment

  • The err filter is a blunt instrument: it excels at filtering success noise (92-98% savings) but adds overhead to already-error-only output.
  • Specialized filters (tsc, cargo, lint, docker, pip) provide much better results than the generic err filter.
  • Web extraction works well for nav-heavy pages (61%) but less so for content-rich pages with minimal chrome (5-18%).
  • The best real-world savings come from: cargo test --list (99.6%), Docker build success (92-97%), pip install (90-99%), and Go/Node.js stacktraces (80-97%).