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 11:44:37 UTC
[PR] [improve][broker] Pre-size individual acknowledgment lists [pulsar]
lhotari opened a new pull request, #26517:
URL: https://github.com/apache/pulsar/pull/26517
### Motivation
Grouped individual acknowledgments build position and deferred-completion lists one element at a time. The command already provides the message count, so growing the backing arrays adds allocation and copying on the broker acknowledgment path.
### Modifications
- Pre-size the non-transactional position and completion lists from the command's message count.
- Avoid creating the unused non-transactional completion list for transactional acknowledgments.
- Construct validation diagnostic positions only when the command has a validation error.
- Add coverage for empty, single and 1,000-message acknowledgment groups, validation errors, position ordering and completion after persistence, plus a focused list-assembly JMH benchmark.
### Verifying this change
The existing experiment on Linux x86_64 / Corretto 25 / ZGC used two JMH forks, three 1-second warmups and five 1-second measurements with the GC profiler. For 1,000 IDs, the isolated list-assembly benchmark measured **131,520 → 88,096 B/group** (33% less allocation) and **12,031.6 → 8,717.4 ns/group** (27.5% less time). It excludes pending-ACK lookups, persistence and broker IO; these are not end-to-end throughput results. The diagnostic-position guard is not included in that benchmark.
Local extraction validation passed: all Spotless and main/test Checkstyle tasks, both scoped broker test classes (11 tests, no failures), and compilation of the benchmark.
```shell
./gradlew spotlessCheck checkstyleMain checkstyleTest \
:pulsar-broker:test \
--tests org.apache.pulsar.broker.service.ConsumerTest \
--tests org.apache.pulsar.broker.service.MessageCumulativeAckTest \
:microbench:compileJava -PtestRetryCount=0 --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] Pre-size individual acknowledgment lists [pulsar]
Posted by "merlimat (via GitHub)" <gi...@apache.org>.
merlimat merged PR #26517:
URL: https://github.com/apache/pulsar/pull/26517
--
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