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

Adding perf benchmark logic for GroupIdGenerator hash map #14992

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

shauryachats
Copy link
Contributor

This PR adds performance benchmarking logic to identify and measure the improvement of different strategies for hash map selection, to make a data-driven choice on the hash map used to power GroupIdGenerator, which has been described in the issue #14685.

The results of this benchmark are:

Benchmark                                                 (_cardinality)  Mode  Cnt     Score     Error  Units              
BenchmarkObjectOpenHashMap.object2IntOpenHashMap                  500000  avgt   20   111.262 ±   5.448  ms/op              
BenchmarkObjectOpenHashMap.object2IntOpenHashMap                 1000000  avgt   20   299.255 ±   9.814  ms/op              
BenchmarkObjectOpenHashMap.object2IntOpenHashMap                 5000000  avgt   20  1859.503 ±  58.990  ms/op              
BenchmarkObjectOpenHashMap.object2IntOpenHashMap                20000000  avgt   20  8236.525 ± 170.751  ms/op      
        
BenchmarkObjectOpenHashMap.object2IntReservedOpenHashMap          500000  avgt   20    79.908 ±   4.715  ms/op              
BenchmarkObjectOpenHashMap.object2IntReservedOpenHashMap         1000000  avgt   20   180.827 ±  19.987  ms/op              
BenchmarkObjectOpenHashMap.object2IntReservedOpenHashMap         5000000  avgt   20  1051.368 ±  49.204  ms/op              
BenchmarkObjectOpenHashMap.object2IntReservedOpenHashMap        20000000  avgt   20  3340.668 ± 106.874  ms/op 
             
BenchmarkObjectOpenHashMap.vanillaHashMap                         500000  avgt   20   109.589 ±   2.836  ms/op              
BenchmarkObjectOpenHashMap.vanillaHashMap                        1000000  avgt   20   265.262 ±   5.215  ms/op              
BenchmarkObjectOpenHashMap.vanillaHashMap                        5000000  avgt   20  1556.399 ±  49.787  ms/op              
BenchmarkObjectOpenHashMap.vanillaHashMap                       20000000  avgt   20  6757.234 ± 314.138  ms/op     
         
BenchmarkObjectOpenHashMap.vanillaReservedHashMap                 500000  avgt   20    98.798 ±   4.344  ms/op              
BenchmarkObjectOpenHashMap.vanillaReservedHashMap                1000000  avgt   20   228.480 ±   6.570  ms/op              
BenchmarkObjectOpenHashMap.vanillaReservedHashMap                5000000  avgt   20  1067.580 ±  48.764  ms/op              
BenchmarkObjectOpenHashMap.vanillaReservedHashMap               20000000  avgt   20  4725.897 ± 284.449  ms/op    

which yields that the reserved hashmap performs ~2.5x better than the current unreserved hashmap, which led to the following PR: #14981.

@codecov-commenter
Copy link

codecov-commenter commented Feb 5, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 63.68%. Comparing base (59551e4) to head (6e70a53).
Report is 1673 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master   #14992      +/-   ##
============================================
+ Coverage     61.75%   63.68%   +1.93%     
- Complexity      207     1480    +1273     
============================================
  Files          2436     2713     +277     
  Lines        133233   152171   +18938     
  Branches      20636    23526    +2890     
============================================
+ Hits          82274    96912   +14638     
- Misses        44911    47969    +3058     
- Partials       6048     7290    +1242     
Flag Coverage Δ
custom-integration1 100.00% <ø> (+99.99%) ⬆️
integration 100.00% <ø> (+99.99%) ⬆️
integration1 100.00% <ø> (+99.99%) ⬆️
integration2 0.00% <ø> (ø)
java-11 63.66% <ø> (+1.95%) ⬆️
java-21 63.56% <ø> (+1.94%) ⬆️
skip-bytebuffers-false 63.67% <ø> (+1.92%) ⬆️
skip-bytebuffers-true 63.55% <ø> (+35.82%) ⬆️
temurin 63.68% <ø> (+1.93%) ⬆️
unittests 63.68% <ø> (+1.93%) ⬆️
unittests1 56.23% <ø> (+9.34%) ⬆️
unittests2 34.02% <ø> (+6.28%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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.

2 participants