GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — [improve][broker] Optimize consumer selection for shared subscriptions by lhotari · Pull Request #26593 · apache/pulsar Conversation
Member
MotivationShared subscriptions perform priority checks during consumer selection even when every consumer has the same priority. With mixed priorities, round-robin wraparound can also rescan higher-priority consumers to locate the current priority group. Reducing this work lowers selection overhead while preserving priority ordering and round-robin behavior. Modifications
Verifying this change
Added tests cover:
Local validation passed:
JMH comparisonCompared baseline Environment: Apple M3 Max, macOS arm64, Corretto 25.0.4, JMH 1.37; two forks, three 500-ms warmup iterations, five 500-ms measurement iterations, one thread, and the GC profiler. Builds and tests did not overlap measurements. Values below are mean nanoseconds per selection. Ranges cover priority offsets zero and three; speedups compare matching cases.
No GC occurred, and measured allocation was approximately zero. The 256-consumer mixed-priority These measurements isolate selection cost and exclude dispatcher locking, membership updates, and message processing. Linux x86_64 confirmation is needed before extrapolating to broker throughput. Does this pull request potentially affect one of the following parts:
Selection and membership helpers explicitly synchronize on the existing dispatcher monitor so the consumer list and priority counts remain consistent. Existing dispatch call sites already hold that monitor.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactionsPreserve selection and availability-check order while isolating list traversal for benchmarking. Keep the dispatcher cursor and lifecycle checks in place. Assisted-by: Codex Measure ready, sparse, lower-priority, blocked and changing-permit consumers with persistent round-robin state. This revision is the unoptimized baseline. Assisted-by: Codex Track MutableInt priority counts with synchronized membership updates, removing entries when their count reaches zero. Use availability-only round-robin traversal for one priority and reuse group boundaries for mixed priorities. Preserve the bulk-removal repair path for inconsistent dispatcher membership. Validate with JMH comparisons against the benchmark-only parent, including 50 consumers at one priority, selection-order and membership tests, dispatcher recovery tests, explicitly enabled priority tests, and quickCheck. Assisted-by: Codex
lhotari
requested review from
Technoboy-,
dao-jun,
david-streamlio,
merlimat and
nodece
merlimat
approved these changes
Uh oh!
There was an error while loading. Please reload this page.
dao-jun
pushed a commit
to ascentstream/pulsar
that referenced
this pull request
apache#26593) (cherry picked from commit e7cbb33)
dao-jun
pushed a commit
to ascentstream/pulsar
that referenced
this pull request
apache#26593) (cherry picked from commit e7cbb33)
dao-jun
pushed a commit
to ascentstream/pulsar
that referenced
this pull request
apache#26593) (cherry picked from commit e7cbb33)
Radiancebobo
pushed a commit
to Radiancebobo/pulsar
that referenced
this pull request
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ReviewersUh oh!
There was an error while loading. Please reload this page. AssigneesNo one assignedLabels
None yet
ProjectsDevelopmentSuccessfully merging this pull request may close these issues. Uh oh!
There was an error while loading. Please reload this page. 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. | ||||||||||||||||||||||||||||||||||||
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |