v148 · Summarizer API · benchmark
Quality vs Speed Benchmark
Run the same text through all three performancePreference modes simultaneously. Compare output quality, word count, estimated inference time, and a key-facts faithfulness score side by side.
input text
Streaming output
(shows token-by-token for each mode)
results
Speed
fast
Words—
Time (ms)—
Run benchmark to see output…
Balanced
balanced
Words—
Time (ms)—
Run benchmark to see output…
Quality
quality
Words—
Time (ms)—
Run benchmark to see output…
how it works
- Feature-detects
window.Summarizer. Falls back gracefully if unavailable. - Creates three
Summarizerinstances viaSummarizer.create({performancePreference: 'speed' | 'balanced' | 'quality'}). - Fires all three summarization calls simultaneously via
Promise.allSettled(). - When streaming mode is on,
summarizer.summarizeStreaming(text)streams tokens into each card's output. - Faithfulness score is simulated: counts how many of the input's noun phrases (words >5 chars, capitalised or content words) appear in the output.
The faithfulness score is a heuristic for demo purposes — not a ground-truth metric.
implementation reference
Need the exact API surface, compatibility boundaries, errors, lifecycle, and source links? Read the matching gendn reference ↗