feat(perf): add performance budget enforcement and nightly CI benchmarks#99
Merged
Merged
Conversation
- 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 projectstests/performance/budgets.json— JSON configuration definingmaxDurationMsandmaxMemoryDeltaMbthresholds per project size tierjest.performance.config.js— Dedicated Jest config that runs budget tests against the real filesystem (bypassesfs-extramocks used by the main config)jest.config.js— Excludesbudget.test.jsfrom the mocked project via a negation pattern so tests only run under the performance configpackage.json— Addstest:performanceandbenchmark:discoveryscripts.github/workflows/performance.yml— Nightly scheduled benchmark (02:00 UTC) withworkflow_dispatchfor on-demand runs; uploads result JSON artifacts; writes key metrics to the GitHub step summarytests/performance/file-discovery.bench.js— Fixed ESM incompatibility (require('os')→ ESMimport os); addedensureDirbefore writing result JSONtests/performance/results/.gitkeep— Placeholder for artifact directory (result JSONs are gitignored).gitignore— Ignorestests/performance/results/*.jsonto avoid committing local benchmark artifacts