Skip to content

feat: add runnable benchmark suite for diff viewer comparison#5

Merged
Zhang-JiahangH merged 9 commits into
mainfrom
codex/setup-benchmark-tests-for-diff-viewers
Apr 7, 2026
Merged

feat: add runnable benchmark suite for diff viewer comparison#5
Zhang-JiahangH merged 9 commits into
mainfrom
codex/setup-benchmark-tests-for-diff-viewers

Conversation

@Zhang-JiahangH
Copy link
Copy Markdown
Owner

Motivation

  • Provide a reproducible, runnable benchmark harness to compare rendering performance of react-virtualized-diff against common alternatives (react-diff-viewer, react-diff-view) on large inputs prior to release.
  • Measure practical metrics for decision-making: initial render latency, average FPS during an auto-scroll scenario, and JS heap usage for a variety of dataset sizes.

Description

  • Added a Vite benchmark app at apps/benchmark which generates synthetic diffs and can render any of the three libraries via URL params; new files include apps/benchmark/src/main.tsx, apps/benchmark/index.html, apps/benchmark/package.json, apps/benchmark/tsconfig.json, and apps/benchmark/vite.config.ts.
  • Added an automated runner scripts/run-benchmark.mjs that launches the benchmark app and uses Playwright to exercise every combination of library and sizes (1k / 10k / 50k / 100k lines), then writes results to benchmark-results/results.json and benchmark-results/results.md.
  • Updated root package.json to add a benchmark script (node ./scripts/run-benchmark.mjs) and declared playwright as a dev dependency, and added README documentation describing how to run the suite and the produced output files.

Testing

  • node --check scripts/run-benchmark.mjs passed static Node syntax check successfully.
  • pnpm install failed in this execution environment due to npm registry authorization (403) so dependencies could not be installed and integration run could not be performed here.
  • pnpm -r typecheck failed because apps/benchmark type dependencies (vite/client) were not available due to the failed install (TypeScript error TS2688).

Codex Task

@Zhang-JiahangH Zhang-JiahangH merged commit 9139fa6 into main Apr 7, 2026
1 check failed
@Zhang-JiahangH Zhang-JiahangH deleted the codex/setup-benchmark-tests-for-diff-viewers 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