Skip to content

test(e2e): add an open and render benchmark - #149

Merged
sadmann7 merged 4 commits into
mainfrom
sadman/perf-open-render
Nov 30, 2026
Merged

sadmann7 merged 4 commits into
mainfrom
sadman/perf-open-render

Conversation

@sadmann7

Copy link
Copy Markdown
Owner

Speeding up opening and rendering needs a repeatable number to beat and a check that the output didn't change, and neither existed for whole decks in a production build.

  • pnpm bench (root or @diceui/pptx-e2e) builds harness/bench.html with Vite in production mode and opens five generated decks in headless Chromium: small (an exported fixture, 8 slides), text-heavy (60), image-heavy (40, 24 distinct JPEG and PNG images), many-slides (300, grown from an exported fixture) and shapes-charts (40, presets, custom geometry, groups and two charts each).
  • Per deck it reports unzip, model build, first render, time to first slide, time to all slides, retained heap, and the XML parsing done across the whole run. Each number is the median of --runs fresh pages.
  • --save-build and --against run a saved baseline build and the current build alternately, with the order flipped each run, so machine load lands on both sides. --profile writes an unminified CPU profile and prints the top self-time functions.
  • --shots screenshots every slide at native size, and pnpm bench:diff compares two shot directories pixel by pixel and exits non-zero on any difference.
  • Decks come from scripts/bench/decks.ts with fixed zip dates and seeded image noise, so they are byte-for-byte reproducible. They are written to the gitignored recordings/bench/decks/, so no binary is committed.
  • Core declares sideEffects: false, and Vite 8 then drops the ECharts registration in renderer/chart/echarts.ts, so every chart fails with painterCtors[rendererType] is not a constructor. The bench build marks that module as having side effects. The same failure probably hits apps that bundle core with Vite 8 and is left for a separate fix.

Baseline on main at caea2eb, median of 7 runs, Chromium headless shell 156 on Linux (4 cores, shared machine), in milliseconds unless noted:

deck slides unzip XML parse (whole run) model build first render open → first slide open → all slides heap (MB)
small 8 36 25 12 20 67 205 6.5
text-heavy 60 50 86 11 22 84 600 6.3
image-heavy 40 37 17 9 88 134 408 26.4
many-slides 300 261 619 28 18 306 3315 33.9
shapes-charts 40 62 135 57 102 219 1023 23.7

An A/A run (the same build on both sides) moves individual stages by up to ±10%, so smaller changes are noise. Two shot runs of the same build match on all 448 slides.

Not shown:

  • Embedded fonts aren't loaded, so the two decks built from the exported fixture render in fallback faces. font-perf covers font decoding.
  • Firefox and Safari not run.

@vercel

vercel Bot commented Nov 30, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
pptx Skipped Skipped Nov 30, 2026 2:11pm UTC

Request Review

@sadmann7
sadmann7 merged commit 1f09031 into main Nov 30, 2026
7 checks passed
@sadmann7
sadmann7 deleted the sadman/perf-open-render branch November 30, 2026 14:28

This branch was previously deployed

1 inactive deployment
Preview — d388d501 Deployed Nov 30, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant