performance-regression-testing
Performance Regression Testing
Any change to the render pipeline must prove it does not increase capture time. The primary guard is serializeTimelineDirect.perf.browsertest.ts, which measures captureTimelineToDataUri end-to-end in multiple scenarios.
Quick Workflow
# Before making changes — record baseline numbers from the terminal output
cd elements
./scripts/browsertest packages/elements/src/preview/rendering/serializeTimelineDirect.perf.browsertest.ts
# Make your changes, then re-run
./scripts/browsertest packages/elements/src/preview/rendering/serializeTimelineDirect.perf.browsertest.ts
The test prints p50, p95, p99 for each scenario. A fix is acceptable if p95 does not regress. Copy the before/after numbers into the PR description as evidence.
What Each Scenario Tests
See serializeTimelineDirect.perf.browsertest.ts for the current scenario list. Typically: simple HTML, text-heavy content, canvas elements, mixed composition at 1920×1080.
Interpreting the Output
Each scenario reports:
p50/p95/p99timing in ms forserializeMs(serialization only) andtotalMs(serialize + image load)dataUriLengthas a proxy for output size
Focus on p95 serializeMs. Small additions to SERIALIZED_STYLE_PROPERTIES add one getComputedStyle lookup per element per serialization — negligible unless the composition has thousands of elements.
Relating Perf to Parity Fixes
When fixing a CSS property gap in SERIALIZED_STYLE_PROPERTIES:
- Run perf before the fix, note p95
- Add the property, re-run perf
- If p95 stays within noise (±5%), the fix is safe
- If p95 climbs, profile with the
profile-testsskill to identify the bottleneck
Broader Perf Tests
For frame-by-frame scrub and full pipeline timing, see:
canvas-scrub-performance.browsertest.tsrenderPipeline.perf.browsertest.ts
These are slower to run (long iteration counts). Use them when the change is structural (e.g., changing how canvases are encoded or how the DOM is walked), not for individual property additions.
When to Use This Skill
- Before and after any change to
serializeTimelineDirect.ts - Before merging a parity fix branch
- When a parity test starts taking noticeably longer than before
More from editframe/skills
video-analysis
Analyze video files using ffprobe, mp4dump, and jq. Use when investigating video samples, keyframes, MP4 box structure, codec info, packet timing, or debugging video playback issues.
74visual-thinking
Create visual analogies by mapping relational structure from familiar domains onto unfamiliar concepts using spatial relationships to make abstract patterns concrete. Covers static diagrams AND animated video storytelling (camera choreography, race comparisons, pacing). Use when explaining complex concepts, creating analogies, designing diagrams, creating explainer animations, or revealing system structure.
70css-animations
CSS animation fill-mode requirements for Editframe timeline system. Use when creating CSS animations, debugging flashing/flickering issues, or when user mentions animation problems, fade effects, slide effects, or sequential animations.
68threejs-compositions
Integrate Three.js 3D scenes into Editframe compositions via addFrameTask. Scenes are pure functions of time, fully scrubable, and renderable to MP4. Use when creating 3D animations, WebGL content in compositions, or integrating Three.js with Editframe's timeline system.
65editor-gui
Build video editing interfaces using Editframe's GUI web components. Assemble timeline, scrubber, filmstrip, preview, and playback controls like lego bricks. Use when creating video editors, editing tools, or when user mentions timeline, scrubber, preview, playback controls, trim handles, or wants to build editing UIs.
63elements-new-package
Create a new @editframe/* workspace package in the elements monorepo and publish it to npm.
63