Skip to content

Add Playwright-powered benchmark suite and runner#6

Merged
Zhang-JiahangH merged 2 commits intomainfrom
codex/setup-benchmark-tests-for-diff-viewers-77rdcd
Apr 7, 2026
Merged

Add Playwright-powered benchmark suite and runner#6
Zhang-JiahangH merged 2 commits intomainfrom
codex/setup-benchmark-tests-for-diff-viewers-77rdcd

Conversation

@Zhang-JiahangH
Copy link
Copy Markdown
Owner

Motivation

  • Provide a reproducible, automated benchmark harness to compare this viewer against other diff viewer libraries across large file sizes and runtime metrics.
  • Collect actionable performance metrics (FPS, initial render time, memory) for datasets up to 100k lines to guide optimization and regressions.

Description

  • Add a new apps/benchmark Vite app with src/main.tsx, index.html, tsconfig.json, vite.config.ts, and a package manifest to host multiple diff viewer implementations for side-by-side benchmarking.
  • Add scripts/run-benchmark.mjs, a Playwright-driven runner that starts the dev server, auto-installs Playwright Chromium if needed, visits benchmark cases for multiple libraries and input sizes, handles per-case timeouts (60s), and emits benchmark-results/results.json and benchmark-results/results.md.
  • Expose a root pnpm benchmark script in package.json and add playwright as a dev dependency, and update README.md and CHANGELOG.md with usage and changelog entries for 0.1.3.
  • The benchmark app supports optional fallback for react-diff-viewer-continued and records timeout cases instead of failing the whole run, and the runner ensures the dev server is stopped cleanly after execution.

Testing

  • No automated tests were executed as part of this change; to run the benchmark locally use pnpm benchmark, which runs the Vite app and a headless Chromium session and writes results to benchmark-results/.

Codex Task

@Zhang-JiahangH Zhang-JiahangH merged commit 3ad0ed7 into main Apr 7, 2026
1 check passed
@Zhang-JiahangH Zhang-JiahangH deleted the codex/setup-benchmark-tests-for-diff-viewers-77rdcd branch April 8, 2026 08:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant