Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid returning to ReadChunkData state #555

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

kornelski
Copy link
Contributor

@kornelski kornelski commented Dec 22, 2024

The chunk size is known ahead of time, and it's always fully read, so there's no need to have a separate state for growing it incrementally.

With the simplified state, it would also be possible to move parsing of chunks after the crc check.

@fintelia
Copy link
Contributor

This might be better to defer until after we've gotten 0.18.0 out.

It has a few consequences that are a bit hard to think through: it allocates space for entire chunks ahead of time rather than waiting to see whether we hit an EOF first and it mem::take's vectors in certain places without a shrink_to_fit first, so their capacity could be far larger than their current length.

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.

2 participants