Skip to content

feat(perf): add performance budget enforcement and nightly CI benchmarks#99

Merged
gregpriday merged 1 commit into
developfrom
feature/issue-21-add-performance-budget
Feb 26, 2026
Merged

feat(perf): add performance budget enforcement and nightly CI benchmarks#99
gregpriday merged 1 commit into
developfrom
feature/issue-21-add-performance-budget

Conversation

@gregpriday
Copy link
Copy Markdown
Owner

Summary

Implements performance budget enforcement (issue #21) by adding Jest-based budget tests, a dedicated non-mocked Jest config, and a nightly GitHub Actions workflow.

Closes #21

Changes Made

  • tests/performance/budget.test.js — Three Jest tests assert that file discovery completes within time and memory budgets for small (100 files), medium (1k files), and large (10k files) synthetic projects
  • tests/performance/budgets.json — JSON configuration defining maxDurationMs and maxMemoryDeltaMb thresholds per project size tier
  • jest.performance.config.js — Dedicated Jest config that runs budget tests against the real filesystem (bypasses fs-extra mocks used by the main config)
  • jest.config.js — Excludes budget.test.js from the mocked project via a negation pattern so tests only run under the performance config
  • package.json — Adds test:performance and benchmark:discovery scripts
  • .github/workflows/performance.yml — Nightly scheduled benchmark (02:00 UTC) with workflow_dispatch for on-demand runs; uploads result JSON artifacts; writes key metrics to the GitHub step summary
  • tests/performance/file-discovery.bench.js — Fixed ESM incompatibility (require('os') → ESM import os); added ensureDir before writing result JSON
  • tests/performance/results/.gitkeep — Placeholder for artifact directory (result JSONs are gitignored)
  • .gitignore — Ignores tests/performance/results/*.json to avoid committing local benchmark artifacts

- Create tests/performance/budget.test.js with Jest assertions for small
  (100 files), medium (1k files), and large (10k files) discovery budgets
- Create tests/performance/budgets.json defining maxDurationMs and
  maxMemoryDeltaMb thresholds for each project size tier
- Create jest.performance.config.js: dedicated non-mocked Jest config so
  budget tests run against the real filesystem (fs-extra not mocked)
- Exclude budget.test.js from the main mocked Jest project via negation
  pattern in jest.config.js
- Add test:performance and benchmark:discovery npm scripts
- Create .github/workflows/performance.yml: nightly scheduled benchmark
  with manual workflow_dispatch, artifact upload, and GitHub step summary
- Fix ESM incompatibility in file-discovery.bench.js (require→os import)
- Add fs.ensureDir before writeJson in file-discovery bench saveResults
- Create tests/performance/results/.gitkeep and gitignore result JSONs
@gregpriday gregpriday merged commit 7014dc0 into develop Feb 26, 2026
11 of 15 checks passed
@gregpriday gregpriday deleted the feature/issue-21-add-performance-budget branch February 26, 2026 03:23
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.

Add performance budget enforcement and nightly benchmarks to CI

1 participant