Skip to content

fix(publish): bound resource reader allocations - #3

Merged
nichinichisou0609 merged 1 commit into
mainfrom
codex/resource-reader-allocation
Oct 27, 2026
Merged

nichinichisou0609 merged 1 commit into
mainfrom
codex/resource-reader-allocation

Conversation

@nichinichisou0609

Copy link
Copy Markdown
Contributor

Resource publication read every object with the full runtime size limit. On Windows, repeatedly allocating a 128 MiB read buffer for small blobs made a roughly 59,000-object validation take about an hour.

Read in bounded 1 MiB chunks until EOF or the first excess byte. The maximum-size check, path checks, content hashing, and decoding remain in place. A local 1,058,591-byte sample returned identical bytes and hashes; 25 complete reader calls took 0.055 seconds instead of 1.167 seconds. This is a sample measurement, not a full-catalogue benchmark.

Validation: 39 tests passed in test_resource_publication.py and test_verified_representations.py, including empty, exact-limit, over-limit, multi-chunk, and short-read cases.

@nichinichisou0609
nichinichisou0609 merged commit c9dac23 into main Oct 27, 2026
4 checks passed
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.

1 participant