Repository navigation
perf(cli): read artifact listing metadata in bulk - #14934
Merged
sipsma merged 4 commits intoNov 2, 2026
Merged
Conversation
sipsma
force-pushed
the
perf/artifact-listing-metadata-20261028
branch
from
November 2, 2026 21:15
80224ad to
095a48a
Compare
sipsma
marked this pull request as ready for review
November 2, 2026 21:15
sipsma
approved these changes
Nov 2, 2026
Signed-off-by: Guillaume de Rouville <[email protected]>
Signed-off-by: Guillaume de Rouville <[email protected]>
The listing test counted calls to a value field it installed itself, but nothing in the listing path calls that field, so the count was always zero. Collections integration tests already check that expanded listings leave real collection leaves unevaluated. Signed-off-by: Erik Sipsma <[email protected]>
The Go client returns a request that fails validation as an HTTP error carrying the GraphQL errors. The matcher also accepted bare gqlerror values and lists, which the client never returns for a validation failure, so only the HTTP error case stays. Signed-off-by: Erik Sipsma <[email protected]>
sipsma
force-pushed
the
perf/artifact-listing-metadata-20261028
branch
from
November 2, 2026 21:55
095a48a to
a97eb9a
Compare
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.
Expanded listings currently create a DagQL Artifact result for every row, then resolve its URI, description, module name and path separately. With thousands of checks, that adds substantial cache and result bookkeeping after collection discovery.
I added an internal
Artifacts.__listingprojection that runs the same collection expansion and returns those metadata fields in one JSON response. The CLI uses it for expanded listings. It falls back to the existing API on older engines only when GraphQL validation reports that the new field is missing; discovery and resolver failures are returned without retrying. Check execution continues through the existing path.For the full Go test listing:
dagger check --module go --check test --list --allWith the Go module unchanged, the latest isolated comparison measured 25.4s → 21.3s median: 4.1 seconds saved, 16% lower latency, with all 4,706 tests listed. Returning to the old CLI measured 26.7s; pooling the before/after controls gives 26.0s → 21.3s, or 18%. I use the conservative 16% figure because the controls drifted. An earlier independent bracket measured 25.5s → 21.8s, or 14.6%.
Raw warm timings, seconds:
Both arms used the same endpoint-capable engine, so the comparison isolates using this new API and its CLI consumer. The benchmark engine privately combines collection PR #14802 at
97a8621c57with main at5c4cdd243b; the Go module is the current dagger/go#84 headeecde50722. The code in this PR is based directly on main and does not include either collection implementation. The other Go/compiler improvements are now separate drafts; the combined result below is not this PR's standalone contribution.Measurements use a warmed engine limited to 8 CPUs, a fresh CLI process, an ordinary source edit and a uniquely named added test before every run. Each run checks every expected test, ordering, complete normalized stdout, successful exit and normal session cleanup. Preparation runs are retained separately and excluded from warm medians. wcprof and CPU/allocation profiles were captured.
Validation completed:
Before the rebase below, CI was green: 92 successful checks and one skipped. The focused race tests also pass after the metadata protocol cleanup. The release note is included.
A local generation run using the collection benchmark engine produced unrelated collection-API diffs; I excluded all of those generated files. The CI SDK generation/staleness checks use the PR source and passed. This PR contains only the bulk metadata change, compatibility tests and release note.
Current-code combined check (2026-10-29): main
4342720d00plus collection branch636dd96749, with Go #84 at1572fd4634, measured 15.505s median after adding the open bulk-listing, prepared-compilation and Go-index changes. Runs were 15.505 / 15.255 / 15.679s. Baseline runs were 28.339 / 26.209s before and 24.745 / 26.245s after. Using the faster control block gives 25.495s → 15.505s, 39% lower latency; pooled controls give 41%. Engine CPU is 116.32s → 35.73s.That is the combined stack, not this PR's standalone contribution. Engine/CLI code is current; the workload is the same fixed 4,706-test root-Go fixture in all arms, with a fresh source edit and unique added test each time. Complete ordered stdout and normal cleanup pass. All arms also contain the identical small table-output buffering fix, prepared separately after the unmodified current CLI silently dropped stdout fragments. That shared prerequisite is not attributed to these performance changes. Telemetry batching and discovery-only scanning are absent from this combined result.
Update: rebased, plus two small fixes
Rebased onto current main (after #15035). Guillaume's two commits are unchanged. Two commits were added on top of them:
valuefield it installed itself. Nothing in the listing path calls that field, so the count was always zero.TestCollectionsalready checks, through the real CLI, that expanded listings leave collection leaves unevaluated, and it now exercises__listingend to end.graphql.HTTPErrorcarrying the parsed GraphQL errors. The matcher's branches for baregqlerrorvalues and lists could not be reached, so they are gone, and the test cases use the real error shape.Measured separately on dagger/dagger's own 4,953 Go tests (
dagger check --go --check test -l --all), with the other three open PRs from this performance series applied in both arms, this PR saves about 2 s in every state: 6.2 → 4.3 s with nothing changed, 16.5 → 14.6 s after a source edit, and 84.0 → 82.4 s on a fresh engine. Those are medians of 3 paired runs on a 16-CPU machine. Every run's output matchedgo test -listand was byte-identical across runs.The dropped stdout fragments mentioned above don't reproduce on current main. #14886, which makes command output wait for queue space instead of dropping it, landed after this PR's original base and is the likely fix.