Repository navigation
perf(registry): fetch only the requested page of tag names - #24343
Open
perfloop-agent wants to merge 3 commits into
Open
perfloop-agent wants to merge 3 commits into
perfloop-agent wants to merge 3 commits into
Conversation
Signed-off-by: Perfloop Agent <agent@perfloop.ai> Signed-off-by: Tomás Senart <ts@perfloop.ai>
Signed-off-by: Perfloop Agent <agent@perfloop.ai> Signed-off-by: Tomás Senart <ts@perfloop.ai>
|
Hi, I'm Tomás, I build Perfloop. I approved this contribution and will handle review feedback here. @chlins, this is in the registry tag list handler ( If you'd like anything in this patch changed, just let me know and I'll update it. |
Signed-off-by: Perfloop Agent <agent@perfloop.ai> Signed-off-by: Tomás Senart <ts@perfloop.ai>
This branch has not been deployed
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.
Comprehensive Summary of your change
For positive
nbelow the maximum integer, local registry tag lists now fetch names strictly afterlastin byte order, with one lookahead row, instead of hydrating every tag. The existing response helper still produces JSON and continuation links. Explicit byte ordering preserves Go comparisons under non-byte database collations, including arbitrary cursor bytes.With PostgreSQL 17 and
n=1000, median Go-allocated bytes for the existing two-tagv1/v2input fell from 13071 to 9175 B/request over 87 paired runs. Larger inputs extend that naming pattern as constructed scaling workloads.Times are medians in ns/request; brackets bound the paired median time saved:
The two-tag paired SQL estimate is 743 ns/request slower, but its bounds span zero; zero overhead is not established. Lower allocations and large-list gains motivate the bounded query.
PostgreSQL time includes SELECT planning and execution, not driver/network waits or CPU time.
Native benchmark:
src/server/registry/tag_benchmark_test.go. Further reproduction fromsrc, with the DAO tests' PostgreSQL settings:go test ./server/registry -run '^$' -bench '^BenchmarkTagList$' -benchtime=8s -count=1 -benchmem.The database may still scan or sort repository tags. Unpaginated requests, maximum-integer counts and proxy local/remote merging retain their existing paths. Production traffic savings are not measured.
Issue being fixed
Paged local tag lists retrieve and hydrate the whole repository before selecting a page.
Validation and contribution checklist
Go tests and race checks passed for tag DAO, manager and controller behavior, registry handling and registry pagination utilities. The database differential test compares response status, JSON and headers against the whole-collection response across mixed names, cursor positions and page boundaries. The native benchmark also completed a one-iteration smoke run at each size.
Please indicate you've done the following:
Case and evidence
Made by Perfloop. Human sponsor: Tomás Senart.