Skip to content

Add a benchmark example and format the decryption code - #1

Merged
xbmc4lyfe merged 1 commit into
mainfrom
claude/bench
Nov 6, 2026
Merged

xbmc4lyfe merged 1 commit into
mainfrom
claude/bench

Conversation

@xbmc4lyfe

Copy link
Copy Markdown
Collaborator

What

  • examples/bench.rs times the paths callers depend on:
    • inflating one 16 MiB entry, and 2,000 entries of about 4 KiB;
    • reading a stored entry;
    • opening a 20,000-entry central directory, and looking names up;
    • ZipCrypto decryption;
    • WinZip AES-CTR decryption, PBKDF2 key derivation and the password check;
    • a whole 1 MiB AES-256 entry.
  • It builds its archives with tests/writer.rs, so it adds no dependency.
  • cargo fmt over the decryption code from a1c381b. That commit left CI's fmt check red on main.

Run it with cargo run --release --example bench [-- word ...]. ROUNDS=n sets the number of rounds. Each case prints its fastest and median round.

Measured (baseline, fastest round)

case M4 Air i7-8700K
inflate-16M 711 MB/s 558 MB/s
inflate-2000x4K 383 MB/s 244 MB/s
zipcrypto-8M 161 MB/s 145 MB/s
aes128-ctr-8M 241 MB/s 55 MB/s
aes256-ctr-8M 175 MB/s 40 MB/s
aes256-accepts 2.43 ms 4.56 ms
aes256-entry-1M 8.6 ms 21.6 ms

Correctness

No library code changes beyond formatting. cargo fmt --check, cargo clippy --all-targets -- -D warnings and cargo test pass.

🤖 Generated with Claude Code

examples/bench.rs times the paths callers lean on: inflating one big and many
small entries, reading a stored entry, opening a large central directory and
looking names up, ZipCrypto decryption, WinZip AES CTR decryption, the PBKDF2
key derivation and password check, and a whole AES-256 entry. It builds its
archives with tests/writer.rs, so it adds no dependency. cargo fmt also
reformats the decryption code from a1c381b, which had left CI's fmt check red.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-06T18:56:51.907362Z 0f5caa0 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@xbmc4lyfe
xbmc4lyfe merged commit 91c301d into main Nov 6, 2026
3 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