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

Faster comparisons for priority queue #285

Merged
merged 1 commit into from
Jan 15, 2025

Conversation

brian-pane
Copy link

No description provided.

@brian-pane
Copy link
Author

The CI errors look like a compiler crash. I don't think the problem is due to this PR itself, but I've only had a very brief look at the error messages.

Anyway, this change improves the CPU cycles at compression levels 1-7 on my test system, with the biggest improvement at level 2:

Benchmark 1 (42 runs): ./blogpost-compress-baseline-native 2 rs silesia-small.tar
  measurement          mean ± σ            min … max           outliers         delta
  wall_time           122ms ±  823us     121ms …  126ms          1 ( 2%)        0%
  peak_rss           24.9MB ± 58.3KB    24.9MB … 25.0MB          0 ( 0%)        0%
  cpu_cycles          496M  ±  758K      495M  …  497M           0 ( 0%)        0%
  instructions       1.06G  ±  323      1.06G  … 1.06G           0 ( 0%)        0%
  cache_references    270K  ± 11.1K      265K  …  338K           2 ( 5%)        0%
  cache_misses        236K  ± 3.79K      215K  …  243K           3 ( 7%)        0%
  branch_misses      6.83M  ± 8.75K     6.82M  … 6.86M           0 ( 0%)        0%
Benchmark 2 (43 runs): ./target/release/examples/blogpost-compress 2 rs silesia-small.tar
  measurement          mean ± σ            min … max           outliers         delta
  wall_time           118ms ± 1.23ms     117ms …  123ms          4 ( 9%)        ⚡-  2.9% ±  0.4%
  peak_rss           24.9MB ± 57.9KB    24.9MB … 25.0MB          0 ( 0%)          -  0.0% ±  0.1%
  cpu_cycles          480M  ± 2.60M      478M  …  496M           1 ( 2%)        ⚡-  3.2% ±  0.2%
  instructions       1.05G  ±  278      1.05G  … 1.05G           3 ( 7%)          -  0.5% ±  0.0%
  cache_references    270K  ± 6.78K      264K  …  293K           6 (14%)          -  0.3% ±  1.5%
  cache_misses        236K  ± 7.55K      210K  …  246K           3 ( 7%)          +  0.2% ±  1.1%
  branch_misses      6.20M  ± 4.66K     6.19M  … 6.21M           0 ( 0%)        ⚡-  9.3% ±  0.0%

Copy link
Collaborator

@folkertdev folkertdev left a comment

Choose a reason for hiding this comment

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

The CI problems are due to a bug in the nightly rust version. Should sort itself out overnight.

These results look awesome, great find! I even get some decent improvements for level 9

@folkertdev folkertdev merged commit e195ff6 into trifectatechfoundation:main Jan 15, 2025
16 of 20 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.

3 participants