Repository navigation
[heft-config-file] Add precompiled JSON schema validator support - #6100
Open
David Michon (dmichon-msft) with Copilot wants to merge 19 commits into
Open
David Michon (dmichon-msft) with Copilot wants to merge 19 commits into
David Michon (dmichon-msft) with Copilot wants to merge 19 commits into
Conversation
Co-authored-by: dmichon-msft <26827560+dmichon-msft@users.noreply.github.com>
Co-authored-by: dmichon-msft <26827560+dmichon-msft@users.noreply.github.com>
Copilot
AI
changed the title
[heft-config-file] Add support for precompiled JSON schema validation
[heft-config-file] Add precompiled JSON schema validator support
Sep 29, 2026
Co-authored-by: dmichon-msft <26827560+dmichon-msft@users.noreply.github.com>
Co-authored-by: dmichon-msft <26827560+dmichon-msft@users.noreply.github.com>
Co-authored-by: dmichon-msft <26827560+dmichon-msft@users.noreply.github.com>
Co-authored-by: dmichon-msft <26827560+dmichon-msft@users.noreply.github.com>
Co-authored-by: dmichon-msft <26827560+dmichon-msft@users.noreply.github.com>
Co-authored-by: dmichon-msft <26827560+dmichon-msft@users.noreply.github.com>
Co-authored-by: dmichon-msft <26827560+dmichon-msft@users.noreply.github.com>
Co-authored-by: dmichon-msft <26827560+dmichon-msft@users.noreply.github.com>
Co-authored-by: dmichon-msft <26827560+dmichon-msft@users.noreply.github.com>
Co-authored-by: dmichon-msft <26827560+dmichon-msft@users.noreply.github.com>
Co-authored-by: dmichon-msft <26827560+dmichon-msft@users.noreply.github.com>
Co-authored-by: dmichon-msft <26827560+dmichon-msft@users.noreply.github.com>
Co-authored-by: dmichon-msft <26827560+dmichon-msft@users.noreply.github.com>
Co-authored-by: dmichon-msft <26827560+dmichon-msft@users.noreply.github.com>
David Michon (dmichon-msft)
left a comment
Collaborator
There was a problem hiding this comment.
Copilot Fix the comment
|
|
||
| it('publishes a precompiled validator for every JSON schema', () => { | ||
| const schemaFiles: string[] = fs | ||
| .readdirSync(schemaFolder) |
Collaborator
There was a problem hiding this comment.
Always use withFileTypes: true for readdir calls
Co-authored-by: dmichon-msft <26827560+dmichon-msft@users.noreply.github.com>
Contributor
Author
Co-authored-by: dmichon-msft <26827560+dmichon-msft@users.noreply.github.com>
Co-authored-by: dmichon-msft <26827560+dmichon-msft@users.noreply.github.com>
This branch has not been deployed
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.
Motivation and measured win
Core Heft startup validates configuration and plugin metadata with AJV. Precompiling built-in validators moves that work from each invocation into the build. A paired comparison of actual builds of this PR and its main base across all 182 runnable downstream Heft consumers in the repository found faster boot on every measured project. The median per-project cold-start saving was 32.5 ms (15.6%), with a range of 18.7–61.3 ms. This supersedes the earlier single-project synthetic estimate.
Changes
*.schema.jsonfiles. Generated modules resolve AJV runtime helpers through the deep@rushstack/node-core-library/lib/JsonSchemaRuntimeimport, so consuming projects do not need to resolve AJV themselves.jsonSchemaValidatorto heft-config-file. Core Heft config, manifest, and built-in plugin option validation use generated validators. Other schema-publishing projects are not yet migrated.Downstream startup profiling
Revisions: main base
f11aaa2vs PR724c10d, each separately installed and built from source in its own directory on the same Linux host (Node 24.22.1). For each project declaring@rushstack/heftas a dependency (excluding Heft itself), launch that revision's self-builtapps/heft/lib-commonjs/start.jsfrom the project's folder withrun --only _profiling_nonexistent_. This deliberately initializes real project configuration and plugin schemas, then stops at the same expected missing-phase error, before any build tasks execute. Both revisions produced that expected result for every measured project. Run one cold-process warmup per revision/project, then five paired cold-process measurements, alternating revision order; report the median of those five runs for each project. Wall time includes process launch; CPU and peak RSS are child-process resource usage. No synthetic validator hook or historical-code approximation was used.Project coverage and median paired wall-time savings by repository area:
appsbuild-testsbuild-tests-samplesbuild-tests-subspaceeslintheft-pluginslibrariesrepo-scriptsrush-pluginsvscode-extensionswebpackOf the 188 repository projects declaring a Heft dependency besides Heft itself, six are rig packages, not standalone Heft build projects:
@rushstack/heft-node-rig,@rushstack/heft-vscode-extension-rig,@rushstack/heft-web-rig,decoupled-local-node-rig,local-node-rig, andlocal-web-rig. They have no rootconfig/heft.json; starting Heft from their package folders fails on both revisions, so they are excluded rather than counted as successful boots. Their consuming projects are included. These results measure initialization through command selection, not build-task execution or performance of external Heft consumers.