Repository navigation
perf(artifact-delivery): cut D1 round trips per run - #496
Merged
Merged
Conversation
The build queue consumer runs in a US colo, and the D1 primary is in Sydney. Each round trip cost about 170 ms in production traces, and a build spent 19 to 22 of them. Every state change wrote, then read the row back. A state change now returns its row with RETURNING, a new Resolution request stores its row in one statement, and a grant that names its Resolution reads the row and its check results in one batch.
Contributor
🤖 MERGED
GitHub merged this pull request. No material findings were recorded. 0ee3121a-c99e-4016-acd0-cebe83e086bd |
Contributor
There was a problem hiding this comment.
Harlan Agent Kit posted this automated review. AI open source policy.
Automated Review: READY.
This was referenced Oct 6, 2026
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.
🔗 Linked issue
None. Launch prep for
skilld runlatency.❓ Type of change
📚 Description
The Artifact build queue consumer runs in a US colo, and the D1 primary is in Sydney. In production traces from 2026-10-07, each D1 round trip from the consumer took 158 to 244 ms, and one build made 19 to 22 of them. Every state change wrote the row, then read it back.
RETURNING *, so it costs one round trip.INSERT ... RETURNING *. A replayed Idempotency-Key finds nothing inserted and reads the existing row.RETURNING, as D1 does.D1 round trips per path, counted by the new tests: