Repository navigation
perf(compile): stop compile importing every command model - #945
Merged
Merged
Conversation
Command-group warehouse selection imported its three small dataclasses from the CLI command models module, which pulls in every command's request and result models. Every command, including warm compiles, paid that import. Move the warehouse scope models beside the CLI entry models and guard the compile import footprint with a fresh-process test.
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.
Why
Since #941, every command, including compile, imported the request and result models of every other command through the warehouse-group helpers: 84 extra modules and about 0.25 s of CPU per process before compiling starts. On a ~1,400-model project, warm and one-model-edit compiles got about 3% slower from 0.133.6 to 0.134.0.
Changes
CommandWarehouseScope,AuthoredTargetWarehouseandResolvedWarehousetosqlbuild.cli.entry.models, which compile already loads, and update their imports.compile --jsonmust not load the build, run or command models.Verification
make test,make check-ci.