Conversation
lhotari
force-pushed
the
lh-perfopt-auto-split-selector-snapshot
branch
from
September 19, 2026 12:20
494712e to
0d02248
Compare
lhotari
changed the base branch from
lh-perfopt-auto-split-selector-base
to
lh-perfopt-iot-performance-tools
September 19, 2026 12:21
lhotari
force-pushed
the
lh-perfopt-iot-performance-tools
branch
from
September 19, 2026 12:35
6c31d73 to
b7456bd
Compare
lhotari
force-pushed
the
lh-perfopt-auto-split-selector-snapshot
branch
from
September 19, 2026 12:35
0d02248 to
d949d8c
Compare
lhotari
force-pushed
the
lh-perfopt-iot-performance-tools
branch
from
September 19, 2026 12:37
b7456bd to
c2926ee
Compare
lhotari
force-pushed
the
lh-perfopt-auto-split-selector-snapshot
branch
from
September 19, 2026 12:38
d949d8c to
ab34a61
Compare
lhotari
force-pushed
the
lh-perfopt-iot-performance-tools
branch
from
September 19, 2026 12:42
c2926ee to
e676723
Compare
lhotari
force-pushed
the
lh-perfopt-auto-split-selector-snapshot
branch
from
September 19, 2026 12:42
ab34a61 to
651dda1
Compare
Publish an immutable lookup snapshot after membership changes so the hot selection path uses primitive-bound binary search instead of a concurrent skip-list lookup. Assisted-by: Codex
lhotari
force-pushed
the
lh-perfopt-iot-performance-tools
branch
from
September 19, 2026 12:47
e676723 to
5d78280
Compare
lhotari
force-pushed
the
lh-perfopt-auto-split-selector-snapshot
branch
from
September 19, 2026 12:47
651dda1 to
99c5d57
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
The AUTO_SPLIT Key_Shared selector performs a
ConcurrentSkipListMap.ceilingEntrylookup for every dispatched message. Consumer membership changes are rare compared with message selection, and those changes are already serialized. A concurrent ordered-map traversal therefore adds pointer chasing and comparison work to the hot path while membership is stable.Modifications
A selection concurrent with a membership change observes either the complete old snapshot or the complete new snapshot. Once
addConsumerorremoveConsumerreturns, the new snapshot has been published.Performance
JMH compares the actual selector with the previous
ConcurrentSkipListMap.ceilingEntrylookup. Runs used two forks, three 1-second warmups, five 1-second measurements, and GC profiling.Both implementations allocate effectively zero on selection. Membership changes allocate the compact snapshot and remain control-plane operations.
A five-million-message scenario with 500 producers and five ten-consumer Key_Shared subscriptions produced two positive matched comparisons:
Every run delivered all messages to every subscription with zero duplicates, ordering violations, or invalid messages. The whole-host gain is larger than the isolated nanosecond saving directly explains, so the table establishes repeatability and absence of regression rather than attributing the full improvement to this lookup.
Verifying this change
This change added tests and can be verified as follows:
./gradlew :microbench:shadowJar quickCheckDoes this pull request potentially affect one of the following parts: