You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "lhotari (via GitHub)" <gi...@apache.org> on 2026/09/10 12:51:57 UTC
[PR] [improve][broker] Use AVL trees for pending acknowledgment entries [pulsar]
lhotari opened a new pull request, #26522:
URL: https://github.com/apache/pulsar/pull/26522
### Motivation
Pending acknowledgment windows repeatedly look up, remove and insert entries in a sorted per-ledger map. The AVL implementation reduced the cost of that cycle in focused benchmarks.
### Modifications
Replace the inner fastutil red-black tree with its AVL counterpart. Preserve the sorted interface, outer ledger map, locking, missing-value sentinel and callbacks. Include tree-operation and actual PendingAcksMap cycle benchmarks.
### Verifying this change
Historical JMH measurements of the actual map cycle, including locks and outer ledger lookup but no contention, were 15.7–21.8% faster with unchanged 48 B/cycle allocation. Some isolated small shuffled lookups were about 2.3 ns slower. Full broker CPU/rate were flat; no end-to-end gain is claimed. These are prior experimental results, not new measurements of this extraction.
Local extraction validation passed: `spotlessCheck checkstyleMain checkstyleTest`, benchmark compilation, and 39 scoped tests with no failures or skips: org.apache.pulsar.broker.service.ConsumerTest (2), org.apache.pulsar.broker.service.PendingAcksMapTest (27), org.apache.pulsar.client.api.KeySharedSubscriptionTest (10). Retries were disabled; Gradle ran with `--max-workers=2 --no-parallel`.
- [ ] Make sure that the change passes the CI checks.
### Does this pull request potentially affect one of the following parts:
- [ ] Dependencies (add or upgrade a dependency)
- [ ] The public API
- [ ] The schema
- [ ] The default values of configurations
- [ ] The threading model
- [ ] The binary protocol
- [ ] The REST endpoints
- [ ] The admin CLI options
- [ ] The metrics
- [ ] Anything that affects deployment
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [improve][broker] Use AVL trees for pending acknowledgment entries [pulsar]
Posted by "nodece (via GitHub)" <gi...@apache.org>.
nodece merged PR #26522:
URL: https://github.com/apache/pulsar/pull/26522
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org