Repository navigation
Conversation
DeclaredGitClients runs on every module function call and parsed the enclosing dagger.toml each time. In a large workspace that parse was about a third of the engine's CPU on a push. Memoize each config's git clients by module scope, keyed by the config's content. Signed-off-by: Yasyf Mohamedali <[email protected]>
Contributor
|
This PR is stale because it has been open 14 days with no activity. Remove stale label or comment or this will be closed in 7 days. |
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.
Parse a module's
dagger.tomlonce per content when looking up its declared git clients.DeclaredGitClientsruns on every module function call and parsed the enclosing config each time. Our workspace has a 61 KBdagger.tomland about 1,200 checks, and a CPU profile of the engine during a push put about a third of its time in that parse. This keeps each config's git clients by module scope, keyed by the SHA-256 of the config's bytes, so the parse runs once per version of the file.Measured on two identical engines (m8id.16xlarge), swapping which host ran the patch between rounds. The push adds one Go file, and every module is checked:
The cache is unbounded. An entry is one config's client lists, and an engine sees few distinct configs, but I can bound it if you prefer.
Relates to #15014.