Skip to content

High-performance browser automation bridge and multi-instance orchestrator with advanced stealth injection and real-time dashboard.

autorun: restore v0.4.0-token-performance.md as separate file

bot7cee07c158b7
diff --git a/tests/v0.4.0-token-performance.md b/tests/v0.4.0-token-performance.md
new file mode 100644
index 00000000..3b52ef51
--- /dev/null
+++ b/tests/v0.4.0-token-performance.md
@@ -0,0 +1,62 @@
+# Token Performance — v0.4.0 (autorun branch)
+
+**Date:** 2026-02-17 08:52 UTC
+**Run by:** Mario (manual)
+**Instance:** headless, clean profile, BRIDGE_NO_RESTORE=true
+
+---
+
+## Results
+
+| Site | /snapshot | ?filter=interactive | ?format=text | /text | /text?mode=raw | Nodes |
+|------|----------|---------------------|-------------|-------|----------------|-------|
+| example.com | ~187 | ~36 | ~100 | ~47 | ~49 | 8 |
+| google.com | ~1,938 | ~564 | ~1,292 | ~764 | ~407 | 87 |
+| github.com | ~9,835 | ~2,160 | ~7,189 | ~1,249 | ~1,570 | 445 |
+| bbc.co.uk | ~23,112 | ~4,848 | ~19,706 | ~3,118 | ~3,621 | 996 |
+| wikipedia (Go) | ~142,154 | ~20,246 | ~97,637 | ~15,676 | ~15,058 | 7,090 |
+| news.ycombinator.com | ~18,643 | ~4,287 | ~12,062 | ~971 | ~1,076 | 966 |
+
+## Reduction Ratios
+
+| Site | interactive vs full | text fmt vs full | /text vs full |
+|------|-------------------|-----------------|--------------|
+| example.com | -81% | -47% | -75% |
+| google.com | -71% | -33% | -61% |
+| github.com | -78% | -27% | -87% |
+| bbc.co.uk | -79% | -15% | -87% |
+| wikipedia | -86% | -31% | -89% |
+| HN | -77% | -35% | -95% |
+
+## Analysis
+
+- **`?filter=interactive`** is the best option for agents that need to interact — 71-86% reduction across all sites
+- **`/text`** is cheapest for content reading — 61-95% reduction, ideal for scraping/reading
+- **`?format=text`** underperforms — only 15-47% reduction vs JSON, not worth the tradeoff
+- **Wikipedia is an outlier** — 142K tokens / 7,090 nodes; needs `maxTokens` or `selector` to be usable
+- **HN shows ideal `/text` efficiency** — 971 tokens for a full page of links
+
+## Cost Estimates (Claude Sonnet, $3/M input)
+
+| Site | Full snapshot | Interactive | /text |
+|------|-------------|-------------|-------|
+| example.com | $0.001 | $0.000 | $0.000 |
+| google.com | $0.006 | $0.002 | $0.002 |
+| github.com | $0.030 | $0.006 | $0.004 |
+| bbc.co.uk | $0.069 | $0.015 | $0.009 |
+| wikipedia | $0.427 | $0.061 | $0.047 |
+| HN | $0.056 | $0.013 | $0.003 |
+
+## Optimization Opportunities
+
+1. **`maxTokens` param** — Truncate snapshot at N tokens. Biggest win for large pages.
+2. **`selector` param** — Scope a11y tree to CSS selector (`#content`, `article`). Eliminates nav/footer noise.
+3. **`exclude` patterns** — Auto-strip nav, footer, cookie banners. Sensible defaults.
+4. **Compact JSON format** — Current nodes are verbose objects. A flat format could halve tokens.
+5. **Viewport scoping** — Only return visible nodes. Below-fold content usually irrelevant.
+
+## Methodology
+
+- Tokens ≈ bytes / 4 (rough estimate for English text)
+- Each site navigated fresh, 4s wait before measurement
+- All endpoints measured sequentially on same page load