Repository navigation
Draft: iterable zip - #487
Its-Just-Nans wants to merge 22 commits into
Conversation
Summary of ChangesHello @Its-Just-Nans, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request introduces an iterable interface for reading zip archives, enhancing the library's usability by allowing developers to easily iterate over the files contained within a zip. It provides a new Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces an IterableZipArchive, a new way to read ZIP archives by iterating over file entries instead of loading them all into memory at once. This is a great addition for handling large archives efficiently.
My review focuses on improving the correctness and robustness of the new iterator implementation. I've suggested changes to make it a proper fallible iterator that correctly handles the number of files and propagates errors, which is crucial for dealing with potentially corrupt archives. I also pointed out some unnecessary code that can be removed to improve clarity.
Overall, this is a valuable feature, and with these changes, it will be more robust and idiomatic.
|
@Its-Just-Nans Is this ready for review? Because it's still marked as a draft. |
Hi I think I still need to do more code like tests and examples with real life examples Also one other benchmark Maybe I will also rename the struct So, no it's not review-ready for now ^^ |
|
This may not be enough to fix #487, because it's unclear if the user needs random access (i.e. to keep using |
|
@Its-Just-Nans When do you expect to continue work on this? I'm wondering if we can target it for 8.1.0. |
|
* feat(read): add index-free iterable ZIP reader Add ZipIterable, an unstable reader that walks the central directory one entry at a time instead of building an in-memory index. This keeps memory usage independent of the number of entries and preserves duplicate names, which ZipArchive cannot represent. Based on the draft implementation in zip-rs#487 by Its-Just-Nans, adapted to the current read module layout and completed with tests, an example, and a criterion benchmark. * feat(read): add enforce_header_consistency to ZipIterable Validates each parsed entry against its local file header before yielding it, matching the check the other readers offer. Duplicate names stay allowed because preserving them is the point of this reader. Also widens the size column in list_files to fit a u64 and gates the SimpleFileOptions import in the iterable tests on the deflate feature.
I think the zip crate should go toward an iterable zip instead of storing every files in memory, since this can lead to memory issue
could fix #486
could fix #488
could fix #240
Example usage of this MR
See the bench file