Skip to content

Make the matches field smaller to improve cache locality#293

Merged
folkertdev merged 2 commits intotrifectatechfoundation:mainfrom
brian-pane:state-struct-size
Feb 13, 2025
Merged

Make the matches field smaller to improve cache locality#293
folkertdev merged 2 commits intotrifectatechfoundation:mainfrom
brian-pane:state-struct-size

Conversation

@brian-pane
Copy link
Contributor

No description provided.

@brian-pane
Copy link
Contributor Author

On my test system, this helps a little at compression level 1, with no statistically significant change at higher levels.

Benchmark 1 (65 runs): ./blogpost-compress-baseline-native 1 rs silesia-small.tar
  measurement          mean ± σ            min … max           outliers         delta
  wall_time          77.1ms ± 1.29ms    74.5ms … 81.4ms          1 ( 2%)        0%
  peak_rss           26.7MB ± 69.9KB    26.5MB … 26.7MB          0 ( 0%)        0%
  cpu_cycles          284M  ±  592K      283M  …  286M           1 ( 2%)        0%
  instructions        536M  ±  282       536M  …  536M           0 ( 0%)        0%
  cache_references    270K  ± 16.8K      264K  …  377K           9 (14%)        0%
  cache_misses        243K  ± 3.36K      230K  …  248K          10 (15%)        0%
  branch_misses      3.07M  ± 5.14K     3.05M  … 3.08M           0 ( 0%)        0%
Benchmark 2 (66 runs): ./target/release/examples/blogpost-compress 1 rs silesia-small.tar
  measurement          mean ± σ            min … max           outliers         delta
  wall_time          75.9ms ±  889us    74.2ms … 78.6ms          1 ( 2%)        ⚡-  1.6% ±  0.5%
  peak_rss           26.7MB ± 73.5KB    26.5MB … 26.9MB          0 ( 0%)          +  0.0% ±  0.1%
  cpu_cycles          280M  ±  837K      279M  …  285M           1 ( 2%)        ⚡-  1.3% ±  0.1%
  instructions        536M  ±  246       536M  …  536M           0 ( 0%)          +  0.0% ±  0.0%
  cache_references    268K  ± 6.94K      264K  …  309K           5 ( 8%)          -  0.9% ±  1.6%
  cache_misses        244K  ± 2.27K      235K  …  247K           7 (11%)          +  0.4% ±  0.4%
  branch_misses      2.99M  ± 6.06K     2.98M  … 3.01M           2 ( 3%)        ⚡-  2.6% ±  0.1%

Copy link
Member

@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.

Cool, I don't see a change locally but overall I think this is a good change, with the possibility of shrinking the structure further in the future.

@folkertdev folkertdev merged commit 64d9729 into trifectatechfoundation:main Feb 13, 2025
20 checks passed
@brian-pane brian-pane deleted the state-struct-size branch April 1, 2025 22:56
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