Skip to content

Conversation

@mkeskells
Copy link
Contributor

SUMMARY

  • Describe your changes, including rationale and design decisions
    no changes to code or unit test. Just benchmarks for addition and lookup

Automated Checks

  • I have run ./gradlew test and made sure that my PR does not break any unit test.

public Roaring64Bitmap addLong(BenchmarkState state) {
Roaring64Bitmap bitmap = new Roaring64Bitmap();
for (long index : state.indexes) {
bitmap.addLong(index);
Copy link
Member

Choose a reason for hiding this comment

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

There are alternatives worth including: Roaring64Bitmap.bitmapOf (it calls the bulked add function underneath). It should run at the same speed (just about) since we have not optimized it, but it has the potential to be optimized dramatically.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added some more methods and patterns

Copy link
Contributor Author

Choose a reason for hiding this comment

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

were there the ones that you wanted

@lemire
Copy link
Member

lemire commented Aug 20, 2025

Please consider my small comment.

@mkeskells
Copy link
Contributor Author

mkeskells commented Aug 20, 2025

from the command line JMH ignores the annotations that control the benchmark (time, iterations, warmups, forks)
there are some settings in the jmh section on build.gradle.kts and it doesnt seem to honour these either, so it looks like you have to provide all of the settings that you want on the command line, as I seee it :-(

e.g. from
java -jar jmh/build/libs/benchmarks.jar -f 1 -r2 -i 5 -w 2 -wi 2 'org.roaringbitmap.longlong.AddRoaring64'

Benchmark                                      (addedSize)  (initialSize)  (orderedAdd)   Mode  Cnt     Score     Error  Units
AddRoaring64.AddExistingState.addAllExisting         10000          10000          true  thrpt    5  4472.812 ┬▒ 139.692  ops/s
AddRoaring64.AddExistingState.addAllExisting         10000          10000         false  thrpt    5  3691.169 ┬▒  35.363  ops/s
AddRoaring64.AddExistingState.addAllExisting         10000         100000          true  thrpt    5  1453.200 ┬▒  39.749  ops/s
AddRoaring64.AddExistingState.addAllExisting         10000         100000         false  thrpt    5  2044.222 ┬▒  89.437  ops/s
AddRoaring64.AddExistingState.addAllExisting         10000        1000000          true  thrpt    5   936.915 ┬▒  42.705  ops/s
AddRoaring64.AddExistingState.addAllExisting         10000        1000000         false  thrpt    5  1233.933 ┬▒  93.725  ops/s
AddRoaring64.AddExistingState.addAllExisting        100000         100000          true  thrpt    5   310.714 ┬▒  12.599  ops/s
AddRoaring64.AddExistingState.addAllExisting        100000         100000         false  thrpt    5   306.943 ┬▒  14.462  ops/s
AddRoaring64.AddExistingState.addAllExisting        100000        1000000          true  thrpt    5    41.127 ┬▒   1.329  ops/s
AddRoaring64.AddExistingState.addAllExisting        100000        1000000         false  thrpt    5    86.146 ┬▒   2.593  ops/s
AddRoaring64.AddExistingState.addAllExisting       1000000        1000000          true  thrpt    5    28.909 ┬▒   1.912  ops/s
AddRoaring64.AddExistingState.addAllExisting       1000000        1000000         false  thrpt    5    28.751 ┬▒   1.997  ops/s
AddRoaring64.AddExistingState.addAllMissing          10000          10000          true  thrpt    5  4004.864 ┬▒  40.681  ops/s
AddRoaring64.AddExistingState.addAllMissing          10000          10000         false  thrpt    5  2708.903 ┬▒  34.390  ops/s
AddRoaring64.AddExistingState.addAllMissing          10000         100000          true  thrpt    5  2174.402 ┬▒  71.567  ops/s
AddRoaring64.AddExistingState.addAllMissing          10000         100000         false  thrpt    5  1666.162 ┬▒ 117.052  ops/s
AddRoaring64.AddExistingState.addAllMissing          10000        1000000          true  thrpt    5  1588.940 ┬▒ 120.153  ops/s
AddRoaring64.AddExistingState.addAllMissing          10000        1000000         false  thrpt    5  1183.865 ┬▒  59.436  ops/s
AddRoaring64.AddExistingState.addAllMissing         100000         100000          true  thrpt    5   236.179 ┬▒  23.169  ops/s
AddRoaring64.AddExistingState.addAllMissing         100000         100000         false  thrpt    5   104.437 ┬▒  33.235  ops/s
AddRoaring64.AddExistingState.addAllMissing         100000        1000000          true  thrpt    5   107.558 ┬▒  43.694  ops/s
AddRoaring64.AddExistingState.addAllMissing         100000        1000000         false  thrpt    5    57.850 ┬▒   5.686  ops/s
AddRoaring64.AddExistingState.addAllMissing        1000000        1000000          true  thrpt    5    28.319 ┬▒   1.308  ops/s
AddRoaring64.AddExistingState.addAllMissing        1000000        1000000         false  thrpt    5     4.247 ┬▒   0.492  ops/s
AddRoaring64.AddExistingState.addEachExisting        10000          10000          true  thrpt    5  4530.683 ┬▒ 100.028  ops/s
AddRoaring64.AddExistingState.addEachExisting        10000          10000         false  thrpt    5  3858.782 ┬▒ 111.641  ops/s
AddRoaring64.AddExistingState.addEachExisting        10000         100000          true  thrpt    5  1472.746 ┬▒  58.905  ops/s
AddRoaring64.AddExistingState.addEachExisting        10000         100000         false  thrpt    5  2009.565 ┬▒ 168.563  ops/s
AddRoaring64.AddExistingState.addEachExisting        10000        1000000          true  thrpt    5   926.241 ┬▒  79.520  ops/s
AddRoaring64.AddExistingState.addEachExisting        10000        1000000         false  thrpt    5  1202.095 ┬▒ 113.610  ops/s
AddRoaring64.AddExistingState.addEachExisting       100000         100000          true  thrpt    5   296.053 ┬▒   8.797  ops/s
AddRoaring64.AddExistingState.addEachExisting       100000         100000         false  thrpt    5   293.941 ┬▒   9.989  ops/s
AddRoaring64.AddExistingState.addEachExisting       100000        1000000          true  thrpt    5    39.966 ┬▒   5.048  ops/s
AddRoaring64.AddExistingState.addEachExisting       100000        1000000         false  thrpt    5    85.832 ┬▒   5.365  ops/s
AddRoaring64.AddExistingState.addEachExisting      1000000        1000000          true  thrpt    5    29.639 ┬▒   1.038  ops/s
AddRoaring64.AddExistingState.addEachExisting      1000000        1000000         false  thrpt    5    29.414 ┬▒   0.840  ops/s
AddRoaring64.AddExistingState.addEachMissing         10000          10000          true  thrpt    5  3926.119 ┬▒  74.459  ops/s
AddRoaring64.AddExistingState.addEachMissing         10000          10000         false  thrpt    5  2992.093 ┬▒  35.117  ops/s
AddRoaring64.AddExistingState.addEachMissing         10000         100000          true  thrpt    5  2153.022 ┬▒  74.545  ops/s
AddRoaring64.AddExistingState.addEachMissing         10000         100000         false  thrpt    5  1674.581 ┬▒  54.532  ops/s
AddRoaring64.AddExistingState.addEachMissing         10000        1000000          true  thrpt    5  1607.802 ┬▒  64.789  ops/s
AddRoaring64.AddExistingState.addEachMissing         10000        1000000         false  thrpt    5  1226.357 ┬▒  78.298  ops/s
AddRoaring64.AddExistingState.addEachMissing        100000         100000          true  thrpt    5   236.255 ┬▒   7.855  ops/s
AddRoaring64.AddExistingState.addEachMissing        100000         100000         false  thrpt    5   116.561 ┬▒  15.281  ops/s
AddRoaring64.AddExistingState.addEachMissing        100000        1000000          true  thrpt    5   127.036 ┬▒   4.526  ops/s
AddRoaring64.AddExistingState.addEachMissing        100000        1000000         false  thrpt    5    62.137 ┬▒   7.379  ops/s
AddRoaring64.AddExistingState.addEachMissing       1000000        1000000          true  thrpt    5    27.477 ┬▒   2.181  ops/s

@mkeskells mkeskells requested a review from lemire August 20, 2025 23:07
@lemire lemire merged commit 6feaa51 into RoaringBitmap:master Aug 20, 2025
@lemire
Copy link
Member

lemire commented Aug 20, 2025

@mkeskells JMH is the de facto standard for running benchmarks in Java, but it has downsides.

@lemire
Copy link
Member

lemire commented Aug 20, 2025

Merged.

@mkeskells mkeskells mentioned this pull request Aug 21, 2025
1 task
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