Skip to content

Native cursor window - #1050

Draft
kennethshackleton wants to merge 1 commit into
bloomberg:mainfrom
kennethshackleton:native-cursor
Draft

Native cursor window#1050
kennethshackleton wants to merge 1 commit into
bloomberg:mainfrom
kennethshackleton:native-cursor

Conversation

@kennethshackleton

@kennethshackleton kennethshackleton commented Aug 25, 2026

Copy link
Copy Markdown
Member

Mac JMH

Summary

Heap Allocation

rowCount NATIVE alloc.norm (JDK17 / JDK25) SIMPLE alloc.norm (JDK17 / JDK25)
1 168 B / 408 B 144 B / 120 B
50 168 B / 408 B 3,360 B / 3,400 B
1000 168 B / 408 B 84,008 B / 84,008 B
50000 168 B / 416 B 4,451,081 B / 4,451,087 B

Throughput

rowCount NATIVE (JDK17 / JDK25) SIMPLE (JDK17 / JDK25) NATIVE speedup
1000 21.1 / 20.9 µs 29.8 / 28.3 µs ~29% / ~26%
50000 902.1 / 878.4 µs 1320.6 / 1236.9 µs ~32% / ~29%

Java 25

% ./gradlew :selekt-java:jmhJava25 -Pjmh.includes=CursorWindowBenchmark -Pjmh.profilers=gc -q

Benchmark                                                   (cursorFactory)  (rowCount)  Mode  Cnt        Score    Error   Units
CursorWindowBenchmark.fillCursorWindow                               NATIVE           1  avgt   10        2.839 ±  0.072   us/op
CursorWindowBenchmark.fillCursorWindow:·gc.alloc.rate                NATIVE           1  avgt   10      137.061 ±  3.402  MB/sec
CursorWindowBenchmark.fillCursorWindow:·gc.alloc.rate.norm           NATIVE           1  avgt   10      408.001 ±  0.001    B/op
CursorWindowBenchmark.fillCursorWindow:·gc.count                     NATIVE           1  avgt   10        4.000           counts
CursorWindowBenchmark.fillCursorWindow:·gc.time                      NATIVE           1  avgt   10        5.000               ms
CursorWindowBenchmark.fillCursorWindow                               NATIVE          50  avgt   10        4.074 ±  0.073   us/op
CursorWindowBenchmark.fillCursorWindow:·gc.alloc.rate                NATIVE          50  avgt   10       95.513 ±  1.690  MB/sec
CursorWindowBenchmark.fillCursorWindow:·gc.alloc.rate.norm           NATIVE          50  avgt   10      408.002 ±  0.001    B/op
CursorWindowBenchmark.fillCursorWindow:·gc.count                     NATIVE          50  avgt   10        2.000           counts
CursorWindowBenchmark.fillCursorWindow:·gc.time                      NATIVE          50  avgt   10        3.000               ms
CursorWindowBenchmark.fillCursorWindow                               NATIVE        1000  avgt   10       20.856 ±  0.199   us/op
CursorWindowBenchmark.fillCursorWindow:·gc.alloc.rate                NATIVE        1000  avgt   10       18.654 ±  0.175  MB/sec
CursorWindowBenchmark.fillCursorWindow:·gc.alloc.rate.norm           NATIVE        1000  avgt   10      408.009 ±  0.001    B/op
CursorWindowBenchmark.fillCursorWindow:·gc.count                     NATIVE        1000  avgt   10          ≈ 0           counts
CursorWindowBenchmark.fillCursorWindow                               NATIVE       50000  avgt   10      878.418 ±  9.268   us/op
CursorWindowBenchmark.fillCursorWindow:·gc.alloc.rate                NATIVE       50000  avgt   10        0.452 ±  0.037  MB/sec
CursorWindowBenchmark.fillCursorWindow:·gc.alloc.rate.norm           NATIVE       50000  avgt   10      416.142 ± 37.160    B/op
CursorWindowBenchmark.fillCursorWindow:·gc.count                     NATIVE       50000  avgt   10          ≈ 0           counts
CursorWindowBenchmark.fillCursorWindow                               SIMPLE           1  avgt   10        2.706 ±  0.056   us/op
CursorWindowBenchmark.fillCursorWindow:·gc.alloc.rate                SIMPLE           1  avgt   10       42.291 ±  0.844  MB/sec
CursorWindowBenchmark.fillCursorWindow:·gc.alloc.rate.norm           SIMPLE           1  avgt   10      120.001 ±  0.001    B/op
CursorWindowBenchmark.fillCursorWindow:·gc.count                     SIMPLE           1  avgt   10        1.000           counts
CursorWindowBenchmark.fillCursorWindow:·gc.time                      SIMPLE           1  avgt   10        1.000               ms
CursorWindowBenchmark.fillCursorWindow                               SIMPLE          50  avgt   10        4.335 ±  0.052   us/op
CursorWindowBenchmark.fillCursorWindow:·gc.alloc.rate                SIMPLE          50  avgt   10      747.965 ±  8.977  MB/sec
CursorWindowBenchmark.fillCursorWindow:·gc.alloc.rate.norm           SIMPLE          50  avgt   10     3400.002 ±  0.001    B/op
CursorWindowBenchmark.fillCursorWindow:·gc.count                     SIMPLE          50  avgt   10       17.000           counts
CursorWindowBenchmark.fillCursorWindow:·gc.time                      SIMPLE          50  avgt   10       13.000               ms
CursorWindowBenchmark.fillCursorWindow                               SIMPLE        1000  avgt   10       28.260 ±  0.165   us/op
CursorWindowBenchmark.fillCursorWindow:·gc.alloc.rate                SIMPLE        1000  avgt   10     2834.599 ± 16.416  MB/sec
CursorWindowBenchmark.fillCursorWindow:·gc.alloc.rate.norm           SIMPLE        1000  avgt   10    84008.012 ±  0.002    B/op
CursorWindowBenchmark.fillCursorWindow:·gc.count                     SIMPLE        1000  avgt   10       64.000           counts
CursorWindowBenchmark.fillCursorWindow:·gc.time                      SIMPLE        1000  avgt   10       34.000               ms
CursorWindowBenchmark.fillCursorWindow                               SIMPLE       50000  avgt   10     1236.901 ± 11.893   us/op
CursorWindowBenchmark.fillCursorWindow:·gc.alloc.rate                SIMPLE       50000  avgt   10     3431.494 ± 32.574  MB/sec
CursorWindowBenchmark.fillCursorWindow:·gc.alloc.rate.norm           SIMPLE       50000  avgt   10  4451087.270 ± 21.969    B/op
CursorWindowBenchmark.fillCursorWindow:·gc.count                     SIMPLE       50000  avgt   10       77.000           counts
CursorWindowBenchmark.fillCursorWindow:·gc.time                      SIMPLE       50000  avgt   10       46.000               ms

Java 17

% ./gradlew :selekt-java:jmhJava17 -Pjmh.includes=CursorWindowBenchmark -Pjmh.profilers=gc -q

Benchmark                                                   (cursorFactory)  (rowCount)  Mode  Cnt        Score    Error   Units
CursorWindowBenchmark.fillCursorWindow                               NATIVE           1  avgt   10        3.412 ±  0.274   us/op
CursorWindowBenchmark.fillCursorWindow:·gc.alloc.rate                NATIVE           1  avgt   10       47.067 ±  3.717  MB/sec
CursorWindowBenchmark.fillCursorWindow:·gc.alloc.rate.norm           NATIVE           1  avgt   10      168.002 ±  0.001    B/op
CursorWindowBenchmark.fillCursorWindow:·gc.count                     NATIVE           1  avgt   10        1.000           counts
CursorWindowBenchmark.fillCursorWindow:·gc.time                      NATIVE           1  avgt   10          ≈ 0               ms
CursorWindowBenchmark.fillCursorWindow                               NATIVE          50  avgt   10        4.410 ±  0.222   us/op
CursorWindowBenchmark.fillCursorWindow:·gc.alloc.rate                NATIVE          50  avgt   10       36.360 ±  1.762  MB/sec
CursorWindowBenchmark.fillCursorWindow:·gc.alloc.rate.norm           NATIVE          50  avgt   10      168.002 ±  0.001    B/op
CursorWindowBenchmark.fillCursorWindow:·gc.count                     NATIVE          50  avgt   10        1.000           counts
CursorWindowBenchmark.fillCursorWindow:·gc.time                      NATIVE          50  avgt   10          ≈ 0               ms
CursorWindowBenchmark.fillCursorWindow                               NATIVE        1000  avgt   10       21.115 ±  0.437   us/op
CursorWindowBenchmark.fillCursorWindow:·gc.alloc.rate                NATIVE        1000  avgt   10        7.588 ±  0.153  MB/sec
CursorWindowBenchmark.fillCursorWindow:·gc.alloc.rate.norm           NATIVE        1000  avgt   10      168.010 ±  0.003    B/op
CursorWindowBenchmark.fillCursorWindow:·gc.count                     NATIVE        1000  avgt   10        2.000           counts
CursorWindowBenchmark.fillCursorWindow:·gc.time                      NATIVE        1000  avgt   10        2.000               ms
CursorWindowBenchmark.fillCursorWindow                               NATIVE       50000  avgt   10      902.060 ± 12.943   us/op
CursorWindowBenchmark.fillCursorWindow:·gc.alloc.rate                NATIVE       50000  avgt   10        0.178 ±  0.003  MB/sec
CursorWindowBenchmark.fillCursorWindow:·gc.alloc.rate.norm           NATIVE       50000  avgt   10      168.435 ±  0.135    B/op
CursorWindowBenchmark.fillCursorWindow:·gc.count                     NATIVE       50000  avgt   10          ≈ 0           counts
CursorWindowBenchmark.fillCursorWindow                               SIMPLE           1  avgt   10        2.842 ±  0.036   us/op
CursorWindowBenchmark.fillCursorWindow:·gc.alloc.rate                SIMPLE           1  avgt   10       48.316 ±  0.603  MB/sec
CursorWindowBenchmark.fillCursorWindow:·gc.alloc.rate.norm           SIMPLE           1  avgt   10      144.001 ±  0.001    B/op
CursorWindowBenchmark.fillCursorWindow:·gc.count                     SIMPLE           1  avgt   10        1.000           counts
CursorWindowBenchmark.fillCursorWindow:·gc.time                      SIMPLE           1  avgt   10          ≈ 0               ms
CursorWindowBenchmark.fillCursorWindow                               SIMPLE          50  avgt   10        4.183 ±  0.062   us/op
CursorWindowBenchmark.fillCursorWindow:·gc.alloc.rate                SIMPLE          50  avgt   10      766.006 ± 11.229  MB/sec
CursorWindowBenchmark.fillCursorWindow:·gc.alloc.rate.norm           SIMPLE          50  avgt   10     3360.002 ±  0.001    B/op
CursorWindowBenchmark.fillCursorWindow:·gc.count                     SIMPLE          50  avgt   10       17.000           counts
CursorWindowBenchmark.fillCursorWindow:·gc.time                      SIMPLE          50  avgt   10        9.000               ms
CursorWindowBenchmark.fillCursorWindow                               SIMPLE        1000  avgt   10       29.808 ±  0.270   us/op
CursorWindowBenchmark.fillCursorWindow:·gc.alloc.rate                SIMPLE        1000  avgt   10     2687.434 ± 24.020  MB/sec
CursorWindowBenchmark.fillCursorWindow:·gc.alloc.rate.norm           SIMPLE        1000  avgt   10    84008.014 ±  0.004    B/op
CursorWindowBenchmark.fillCursorWindow:·gc.count                     SIMPLE        1000  avgt   10       60.000           counts
CursorWindowBenchmark.fillCursorWindow:·gc.time                      SIMPLE        1000  avgt   10       29.000               ms
CursorWindowBenchmark.fillCursorWindow                               SIMPLE       50000  avgt   10     1320.562 ± 12.107   us/op
CursorWindowBenchmark.fillCursorWindow:·gc.alloc.rate                SIMPLE       50000  avgt   10     3214.136 ± 29.010  MB/sec
CursorWindowBenchmark.fillCursorWindow:·gc.alloc.rate.norm           SIMPLE       50000  avgt   10  4451080.636 ±  0.196    B/op
CursorWindowBenchmark.fillCursorWindow:·gc.count                     SIMPLE       50000  avgt   10       72.000           counts
CursorWindowBenchmark.fillCursorWindow:·gc.time                      SIMPLE       50000  avgt   10       39.000               ms

@kennethshackleton
kennethshackleton force-pushed the native-cursor branch 30 times, most recently from 41ba1b0 to 51a8984 Compare August 28, 2026 13:30
Signed-off-by: Ken Shackleton <kshackleton1@bloomberg.net>
@sonarqubecloud

Copy link
Copy Markdown

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.

1 participant