Skip to content

perf: speed up version metadata reads - #668

Merged
majd merged 2 commits into
mainfrom
branch/issue-663-metadata-read-ahead
Nov 12, 2026
Merged

majd merged 2 commits into
mainfrom
branch/issue-663-metadata-read-ahead

Conversation

@majd

@majd majd commented Nov 12, 2026

Copy link
Copy Markdown
Owner

Closes #663.

Add 1 MiB read-ahead caching for remote IPA reads so get-version-metadata avoids repeated small range requests and Store emulator executions while parsing ZIP central directories.

Preserve usable data from interrupted read-ahead responses, validate Content-Range before caching, and add regression coverage for cache boundaries, backward reads, EOF, and concurrent access.

rxliuli and others added 2 commits November 12, 2026 23:30
get-version-metadata reads Info.plist out of the remote IPA through
httpRangeReaderAt. archive/zip parses the central directory through a
4 KiB bufio.Reader, and each ReadAt was a separate range request. Those
requests go through the Store "transfer" client, which opens the emulator
for every request, so an IPA with many files cost hundreds of emulator
round trips: 298 requests and ~71s (55s CPU) for one Chrome version.

On a miss, httpRangeReaderAt now fetches at least 1 MiB starting at the
requested offset and serves later reads from that window. Reads that cross
EOF are still clamped, and only the end of the IPA is downloaded.
@majd
majd enabled auto-merge (rebase) November 12, 2026 23:06
@majd
majd merged commit b352566 into main Nov 12, 2026
17 checks passed
@majd
majd deleted the branch/issue-663-metadata-read-ahead branch November 12, 2026 23:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

get-version-metadata: reading the IPA central directory in 4 KiB range requests makes calls take up to ~60s and most of it is CPU

2 participants