GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||
GeezerVison is showing github.com — perf(core): ramp chunk size when seeking large files in read by kitlangton · Pull Request #65611 · anomalyco/opencode Conversation
Contributor
Seeking near the end of a 20 MiB file in ❌ Before
✅ After
if (next !== undefined || byte >= first.info.size) break - const more = yield* range(byte, FIRST_CHUNK) + const length = + entries.length > 0 || (requested > 0 && total >= requested - 1) + ? FIRST_CHUNK + : Math.max(FIRST_CHUNK, Math.min(chunk.length * 4, MAX_SCAN_CHUNK)) + const more = yield* range(byte, Math.min(length, first.info.size - byte)) 📊 Proof (synthetic 20 MiB file in
👀 Read: No feature flag needed (internal read pagination optimization, zero API or wire change) · reviewed once by a second model before pushing Checks run
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The source change looks sound. Chunks only grow while skipping lines toward the requested page, go back to 256 KiB once the page is reached, and are capped at the remaining file size. NUL detection still only covers bytes up to the selected lines. I ran the new read-count tests against the base source and got 80 reads in each scan case, then 7 with this PR. The read suites pass (98/0) and Public API: unchanged (internal read pagination only, no wire, SDK or config change). One request, inline: the added tests are much larger than the 7-line fix needs.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This adds ~160 lines of tests for a 7-line change. Several cases are hard to follow: hand-built byte layouts with offset arithmetic, and expectations that branch on the loop variable through nested ternaries (
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactionsUh oh!
There was an error while loading. Please reload this page.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The tests are now cut down to the read-count table, the check that reads return to 256 KiB after reaching the page, and one short-read case. Exact call-length lists are gone, which addresses my earlier comment. The source is unchanged since my last review. The read suites pass (88/0) and
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
1 task
4 tasks
1 task
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ReviewersUh oh!
There was an error while loading. Please reload this page. AssigneesNo one assignedLabelsProjectsMilestoneNo milestoneDevelopmentSuccessfully merging this pull request may close these issues. Uh oh!
There was an error while loading. Please reload this page. 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. | |||||||||||||||||||||||||||
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |