Skip to content

core: parse a config once per content for its declared git clients - #15021

Open
yasyf wants to merge 1 commit into
dagger:mainfrom
yasyf:git-clients-once-per-config
Open

yasyf wants to merge 1 commit into
dagger:mainfrom
yasyf:git-clients-once-per-config

Conversation

@yasyf

@yasyf yasyf commented Nov 1, 2026

Copy link
Copy Markdown

Parse a module's dagger.toml once per content when looking up its declared git clients.

DeclaredGitClients runs on every module function call and parsed the enclosing config each time. Our workspace has a 61 KB dagger.toml and 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:

Round Before After README-only before README-only after
1 361 s 356 s 39 s 39 s
2 233 s 175 s 38 s 41 s
3 301 s 265 s 45 s 37 s

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.

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]>
@github-actions

Copy link
Copy Markdown
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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant