Merged
Conversation
github-merge-queue bot
pushed a commit
that referenced
this pull request
Jan 28, 2026
* feat: Add support for per-file comments (#1) * Update benches/read_metadata.rs Co-authored-by: n4n5 <git@n4n5.dev> Signed-off-by: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> * Address review feedback Signed-off-by: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> * Address review feedback Signed-off-by: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> * Address review feedback Signed-off-by: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> * Fix: write_file_comment_roundtrip needs to override compression_method in some configurations Signed-off-by: Chris Hennick <4961925+Pr0methean@users.noreply.github.com> * Update write.rs: fix comment syntax Signed-off-by: Chris Hennick <4961925+Pr0methean@users.noreply.github.com> * style: cargo fmt * test: Fix another test that needs a compression_method override * Fix: feature names in cfg attributes incorrectly had underscores instead of hyphens * test: Fix build error --------- Signed-off-by: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> Signed-off-by: Chris Hennick <4961925+Pr0methean@users.noreply.github.com> Co-authored-by: n4n5 <git@n4n5.dev> Co-authored-by: Chris Hennick <4961925+Pr0methean@users.noreply.github.com>
lovasoa
added a commit
to lovasoa/zip2
that referenced
this pull request
Mar 20, 2026
Problem: each ZIP entry stores the filename three times: 1. file_name: Box<str> (decoded) 2. file_name_raw: Box<[u8]> (raw bytes) 3. IndexMap key: Box<str> (clone of zip-rs#1) For a 23K-entry JAR, this means 3 heap allocations per entry just for filenames, totaling ~4.4 MiB of redundant data. Fix: replace zip-rs#1 and zip-rs#2 with a single ZipFileName enum. The Utf8 variant (used for >99% of real-world files) holds one Arc<str> that serves both name() and name_raw(). The IndexMap key becomes Arc<str> sharing the same refcount — zero-cost clone. The write_non_utf8 test is now #[ignore] because it relied on String::from_utf8_unchecked with invalid UTF-8 bytes, which is undefined behavior. A proper fix needs a raw-filename write API. Measured on bazel.jar (23,631 Stored entries): ZipArchive::new() allocations: before: 4.0 allocs/entry, 490 net bytes/entry (94,530 total) after: 3.0 allocs/entry, 378 net bytes/entry (70,899 total) cargo bench read_metadata (15K entries): before: 2,709,974 ns/iter after: 2,486,833 ns/iter (-8.2%) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Welcome to Mend Bolt for GitHub (formerly WhiteSource). This is an onboarding PR to help you understand and configure settings before Mend starts scanning your repository for security vulnerabilities.
🚦 Mend Bolt for GitHub will start scanning your repository only once you merge this Pull Request. To disable Mend Bolt for GitHub, simply close this Pull Request.
What to Expect
This PR contains a '.whitesource' configuration file which can be customized to your needs. If no changes were applied to this file, Mend Bolt for GitHub will use the default configuration.
Before merging this PR, Make sure the Issues tab is enabled. Once you merge this PR, Mend Bolt for GitHub will scan your repository and create a GitHub Issue for every vulnerability detected in your repository.
If you do not want a GitHub Issue to be created for each detected vulnerability, you can edit the '.whitesource' file and set the 'minSeverityLevel' parameter to 'NONE'.
❓ Got questions? Check out Mend Bolt for GitHub docs.
If you need any further assistance then you can also request help here.