Skip to content

Add addon overhead benchmark baseline - #161

Open
mattcosta7 wants to merge 1 commit into
mainfrom
v1.3/01-overhead-baseline
Open

Add addon overhead benchmark baseline#161
mattcosta7 wants to merge 1 commit into
mainfrom
v1.3/01-overhead-baseline

Conversation

@mattcosta7

Copy link
Copy Markdown
Member

Summary

  • add a dedicated headless-Chromium Vitest benchmark project for addon overhead
  • compare identical lifecycle, raw DOM mutation, and React commit work across addon disabled, panel hidden, and panel visible states
  • emit ignored, comparison-ready JSON and document the top-level benchmark and --compare commands
  • run the benchmark in the existing browser CI job and upload its JSON without enforcing timing thresholds
  • pin Vitest and its Playwright provider to 4.1.10 while benchmark support is experimental

The CI benchmark is a functional check only. Its measurements remain diagnostic until repeated runs establish stable variance and defensible budgets.

Validation

  • npm run benchmark
  • npm run benchmark -- --compare <baseline.json>
  • npm run tsc
  • Chromium lifecycle/collector slice: 61 tests passed
  • npm run lint (passes with one existing warning in the forced-reflow collector test)

No changeset is included because this only adds development and CI measurement infrastructure.

workload
) : (
<PerformanceProvider storyId="benchmark-react">
<ProfiledComponent id="React benchmark">{workload}</ProfiledComponent>
@mattcosta7
mattcosta7 marked this pull request as draft August 3, 2026 13:29

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds diagnostic browser benchmarks to establish addon overhead baselines.

Changes:

  • Benchmarks lifecycle, DOM mutation, and React workloads across three addon states.
  • Adds benchmark commands, documentation, JSON output, and CI artifact upload.
  • Pins experimental Vitest benchmark dependencies to 4.1.10.
Show a summary per file
File Description
.github/workflows/ci.yml Runs and uploads benchmark results.
.gitignore Ignores generated benchmark JSON.
CONTRIBUTING.md Documents benchmark usage.
package.json Adds the root benchmark command.
package-lock.json Records exact Vitest versions.
packages/storybook-addon-performance-panel/package.json Adds workspace command and pins dependencies.
packages/storybook-addon-performance-panel/vitest.benchmark.config.ts Configures headless Chromium benchmarks.
packages/storybook-addon-performance-panel/__benchmarks__/overhead.browser.bench.tsx Implements overhead workloads and scenarios.

Review details

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 6/8 changed files
  • Comments generated: 0
  • Review effort level: Balanced

@mattcosta7 mattcosta7 self-assigned this Aug 3, 2026
@mattcosta7
mattcosta7 marked this pull request as ready for review August 3, 2026 16:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants