# Benchmarks & Methodology (https://crow.build/docs/guides/benchmarks)

Every performance claim Crow makes is backed by real hardware measurements, committed raw `.jsonl` traces in `docs/benchmarks/`, and reproducible scripts. No hand-picked microbenchmarks, no debug builds.

## Hardware & Build Conditions [#hardware--build-conditions]

- **Device**: Xiaomi 2201116SG (Qualcomm Snapdragon 695: 2 × Cortex-A78 + 6 × Cortex-A55, 1080 × 2400 @ 440 dpi, **120 Hz**, Android 13)
- **Builds**: R8 full-mode release builds, AOT-compiled identically with `cmd package compile -m speed -f` (except E2 fresh-install TTID, measured under both `verify` and `speed-profile`)
- **Compose baseline**: Compose BOM `2026.11.01` (UI `1.13.0`), measured on both default gap-buffer and link-table composers

---

## 1. E1 — 1,000-Row Feed (Creation, Updates & Heap) [#1-e1--1000-row-feed-creation-updates--heap]

1,000 interactive rows (avatar circle, title, live `"N likes"` counter, clickable like dot with live color) mounted synchronously in a vertical scroll. Medians of 3 runs (25 creation iterations / 40 update rounds per run).

| Metric (Snapdragon 695, medians) | Crow (compiled) | Compose (gap) | Compose (link table) | Crow vs Best Compose |
| --- | --- | --- | --- | --- |
| **Create 1,000 rows** | **76.5 ms** | 489.8 ms | 501.2 ms | **0.16×** (6.4× faster) |
| **GC pauses during mount** | **0 / 25** | 25 / 25 | 25 / 25 | **Zero GC** |
| **Java heap retained** | **1.31 MB** | 20.65 MB | 20.65 MB | **0.06×** (15.8× less) |
| **Native heap retained** | **0.68 MB** | 1.89 MB | 1.89 MB | **0.36×** (2.8× less) |
| **Update 1 of 1,000 rows** | **3.0 ms** | 89.3 ms | 95.1 ms | **0.03×** (29.8× faster) |
| **Update every 10th row (100 rows)** | **25.6 ms** | 101.3 ms | 99.9 ms | **0.26×** (3.9× faster) |

<Callout title="Compiler matches hand-written imperative code" type="info">
Thanks to `LocalGraph` lowering, modifier fusion, and binding fusion, Crow's **compiled** declarative screen retains **1,309 KB** Java heap vs **1,317 KB** for the hand-written imperative Crow UI baseline (−2.6 KB in class-histogram heap dumps) and matches its update latency within noise.
</Callout>

---

## 2. Pokédex — Full App vs Views & Compose (120 Hz) [#2-pokédex--full-app-vs-views--compose-120-hz]

Google's Compose performance page benchmarks `skydoves/Pokedex` (Views) vs `skydoves/pokedex-compose` (Compose). We rebuilt `pokedex-compose` screen for screen in Crow (`benchmarks/pokedex-crow`, ~650 lines: `LazyVerticalGrid`, `crow-query`, `crow-image`, `crow-material3`, shared-element flights, live theme switching) and measured all three back to back in one session (10 cold starts, 5 scroll runs of ~1,030 frames each, zero thermal throttling).

| Metric (Snapdragon 695, 120 Hz) | Views (from source) | Compose | **Crow** | Crow / Compose |
| --- | --- | --- | --- | --- |
| **Cold start (TTID)** | 507.5 ms | 462.5 ms | **394 ms** | **0.85×** |
| **Janky frames (per-run median)** | 0.39% | 0.88% | **0.39%** | **0.44×** |
| **Janky frames (all 5 runs, ~5.1k frames)** | 0.41% (21) | 2.50% (128)¹ | **0.37% (19)** | — |
| **Frame time p50** | 9 ms | 14 ms | **11 ms** | **0.79×** |
| **Frame time p90** | 14 ms | 18 ms | **15 ms** | **0.83×** |
| **Frame time p99** | 17 ms | 29 ms | **23 ms** | **0.79×** |
| **Memory after scrolling (PSS)** | 133.0 MB | 175.1 MB | **156.9 MB** | **0.90×** |

*¹ Compose run 2 experienced a whole-run spike (98 of 128 janky frames); quote per-run median jank (**0.39% vs 0.88%**) rather than the outlier-skewed sum. Even excluding that run, Compose averaged 0.73% vs Crow's 0.37% and Views' 0.41%.*

---

## 3. E2 — Generated DEX Code Size & Cold Start [#3-e2--generated-dex-code-size--cold-start]

A synthetic 150-component, 30-screen Material-shaped catalog generated identically for Crow and Compose, compiled with R8 full mode (`-dontobfuscate` for exact app-code attribution):

| Dynamic Argument Share | Crow App DEX | Compose App DEX | Size Ratio |
| --- | --- | --- | --- |
| **10% dynamic** | **190 KB** (572 methods) | 301 KB (505 methods) | **0.63×** |
| **35% dynamic** | **270 KB** (570 methods) | 340 KB (493 methods) | **0.79×** |
| **60% dynamic** | **318 KB** (571 methods) | 357 KB (455 methods) | **0.89×** |

### E2 Cold Start (21 interleaved launches on Snapdragon 695) [#e2-cold-start-21-interleaved-launches-on-snapdragon-695]

- **`verify` (fresh install, no profiles)**: Crow **387 ms** vs Compose **488 ms** (**0.79×**)
- **`speed-profile`**: Crow **364 ms** vs Compose **464 ms** (**0.78×**) — even though Compose ships baseline profiles and Crow does not yet
- **Whole APK size**: Crow **149 KB** vs Compose **1,035 KB**

## Honest Caveats [#honest-caveats]

- All real-device runs so far are on a single Snapdragon 695 phone; additional gate devices (Pixel 6a and an Android Go phone) are planned.
- Both Pokédex builds were AOT-compiled (`-m speed`), so baseline profiles played no role in the Pokédex cold-start table.
- Pokédex benchmarks measure home-screen cold start and vertical grid flinging; details-screen stat animations are not yet implemented in the Crow port.
- Raw `.jsonl` files and scripts live in `docs/benchmarks/` and `benchmarks/` so anyone can re-run and verify:

```bash
gradle :benchmarks:pokedex-crow:assembleRelease
ANDROID_SERIAL=<serial> benchmarks/pokedex/compare.sh /tmp/pokedex-run 10 5
```