StreamMDX
Benchmarks

Streaming performance benchmarks

Use reproducible harnesses, then validate in-browser behavior with live delta-by-delta comparisons against alternative renderers.

Fixture: naive-bayes.mdScenario: S2_typical (50ms)Mode: incrementalRenderer: V2Methodology documentation

Live renderer comparison lab (sequential)

Renderers run one-by-one to minimize CPU contention. Each engine gets an unscored warmup pass before the scored pass. Metrics split into first-visible commit vs final-stable commit.

State: idle
Active engine: -
Phase: warmup
Run: 0 / 1
Measured passes: 3
Total passes incl. warmup: 6
Delta: 0 / 195
Chars: 0 / 8,165
Throughput: 0 chars/s
1. StreamMDX2. Streamdown3. react-markdown
Current order: -
Methodology mode
Freeform tuning enabled for diagnosis.
Active profile snapshot: chunk=42, interval=32ms, repeats=16, runs=1, order=fixed, workload=parity-gfm. Differs from CI profile.
A scored run is one full cycle across all renderers (then repeated for the configured run count).
Chunk size (chars)42
Emit interval (ms)32
Fixture repeats16
Scored run cycles1
Order mode
Benchmark profile
Chart metric
Split mode shows both metrics.
Chart layout
Per-delta latency (first visible commit - emit time)
Y max: 10 ms
10853000111Delta indexLatency (ms)
Per-delta latency (final stable commit - emit time)
Y max: 10 ms
10853000111Delta indexLatency (ms)
StreamMDXStreamdownreact-markdown
RendererSamplesFirst paint p50First paint p95Final stable p50Final stable p95Run p50Throughput p50
StreamMDX0------
Streamdown0------
react-markdown0------
Metric leaders
First paint p50: -Final stable p50: -Run p50: -Throughput p50: -
StreamMDX: 0 / 4 metric winsStreamdown: 0 / 4 metric winsreact-markdown: 0 / 4 metric wins
CI gate (StreamMDX vs Streamdown)
PENDING • pass=0 fail=0 pending=4Run in CI locked mode before claiming results
First paint p50 <= StreamdownFinal stable p50 <= StreamdownRun p50 <= StreamdownThroughput p50 >= Streamdown
RendererEmit→ingest p50Ingest→commit p50Emit→commit p50Append overhead p50Timer drift p50 / p95
StreamMDX----- / -
Streamdown----- / -
react-markdown----- / -
StreamMDX
Incremental worker parser + patch renderer
No stream data yet.
Streamdown
Drop-in streaming replacement for react-markdown
No stream data yet.
react-markdown
Baseline markdown renderer (full re-render on updates)
No stream data yet.

Method note: each engine runs warmup then scored pass in isolation. Commit timing capture is unified across engines via layout-effect commit hooks to avoid instrumentation bias. Use CI locked mode for claim-grade runs; use explore mode to diagnose bottlenecks. \"First paint\" measures earliest visible commit; \"final stable\" reflects how quickly each delta settles after downstream formatting/render passes.

Static render comparison (content types)

Measures one-shot static rendering across prose, tables, code, and mixed markdown fixtures. Times are captured per engine as first mutation and final settled mutation.

State: idle
Iterations: 3
Progress: 0 / 0
Active fixture: -
Active engine: -
Timeouts: 0
Iterations per fixture3
Prose heavyTable heavyCode heavyMixed rich markdown
Content typeDescriptionStreamMDX first/final p50Streamdown first/final p50react-markdown first/final p50Final p50 winner
Prose heavyLong narrative text with headings, lists, and inline formatting.- / -n=0- / -n=0- / -n=0-
Table heavyLarge table blocks with short explanatory text.- / -n=0- / -n=0- / -n=0-
Code heavyMultiple fenced code blocks with surrounding markdown.- / -n=0- / -n=0- / -n=0-
Mixed rich markdownLists, quotes, links, tasks, and tables in one document.- / -n=0- / -n=0- / -n=0-
StreamMDX
Streamdown
react-markdown

Reproduce

Run the harness locally with the same fixture and scenario.

NEXT_PUBLIC_STREAMING_DEMO_API=true npm run docs:dev
npm run perf:harness -- --fixture naive-bayes --scenario S2_typical --runs 3 --warmup 1 --out tmp/perf-baselines
npm run perf:compare -- --base tmp/perf-baselines/<base> --candidate tmp/perf-baselines/<candidate>

Renderer model comparison

RendererUpdate modelBest fit
StreamMDXIncremental patch applyStreaming UIs + deterministic replay
StreamdownReact re-render on content updatesDrop-in migration from react-markdown
react-markdownReact re-render on content updatesSimple static markdown content