Skip to content

Conversation

@folkertdev
Copy link
Member

minor speedup for very small files

Benchmark 2 (745 runs): target/release/examples/decompress rs tests/input/bzip2-testfiles/go/crypto/SigVer.rsp.bz2
  measurement          mean ± σ            min … max           outliers         delta
  wall_time          6.68ms ±  143us    6.32ms … 7.28ms         29 ( 4%)        ⚡-  5.3% ±  0.2%
  peak_rss           3.08MB ± 66.5KB    2.88MB … 3.15MB          0 ( 0%)          -  0.1% ±  0.2%
  cpu_cycles         24.4M  ±  417K     23.9M  … 27.3M          57 ( 8%)        ⚡-  6.9% ±  0.1%
  instructions       55.7M  ±  305      55.7M  … 55.7M           4 ( 1%)        💩+  3.5% ±  0.0%
  cache_references    378K  ± 27.4K      293K  …  857K          26 ( 3%)          -  0.8% ±  0.6%
  cache_misses        102K  ± 2.02K     98.1K  …  111K           9 ( 1%)        ⚡-  2.3% ±  0.2%
  branch_misses       251K  ± 1.08K      250K  …  257K         134 (18%)        ⚡- 26.6% ±  0.0%

but for larger inputs it's not significant (makes sense)

@folkertdev folkertdev requested a review from bjorn3 January 14, 2025 12:21
@codecov
Copy link

codecov bot commented Jan 14, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Files with missing lines Coverage Δ
libbz2-rs-sys/src/bzlib.rs 92.62% <ø> (ø)
libbz2-rs-sys/src/decompress.rs 93.42% <100.00%> (-0.11%) ⬇️
libbz2-rs-sys/src/huffman.rs 96.83% <100.00%> (+0.02%) ⬆️

let off: i32;
let mut nn: u32;
nn = (nextSym - 1) as u32;
let mut nn = (nextSym - 1) as u32;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

u32::from(nextSym - 1)

@folkertdev folkertdev merged commit ab1cfc8 into main Jan 14, 2025
21 checks passed
@folkertdev folkertdev deleted the shrink-huffman-decode-tables branch January 14, 2025 13:37
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.

3 participants