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 2025/08/19 12:09:21 UTC
[I] [Bug] Performance improvement opportunity in caching parsed message metadata [pulsar]
lhotari opened a new issue, #24644:
URL: https://github.com/apache/pulsar/issues/24644
### Search before reporting
- [x] I searched in the [issues](https://github.com/apache/pulsar/issues) and found nothing similar.
### Read release policy
- [x] I understand that [unsupported versions](https://pulsar.apache.org/contribute/release-policy/#supported-versions) don't get bug fixes. I will attempt to reproduce the issue on a supported version of Pulsar client and Pulsar broker.
### User environment
master branch version of Pulsar, 34f8657
### Issue Description
There's a opportunity to significantly reduce memory allocations in Pulsar by caching parsed message metadata. In a simple profiling test case in https://github.com/apache/pulsar/pull/24623 I noticed that
there's a lot of allocations coming from `org.apache.pulsar.common.protocol.Commands.peekAndCopyMessageMetadata`.
<img width="1102" height="360" alt="Image" src="https://github.com/user-attachments/assets/f03070d6-c5c8-45dc-a2b8-175df4875ddd" />
The broker cache can be modified to support caching the message metadata together with the entries so that unnecessary parsing and allocations can be avoided.
### Error messages
```text
```
### Reproducing the issue
With https://github.com/apache/pulsar/pull/24623 changes, enabling the `BrokerEntryCacheMultiBrokerTest.testTailingReadsRollingRestart` test
by modifying the `@Test(enabled = false)` annotation to `@Test(invocationCount = 5)` and then running
```shell
mvn -PtestAsyncProfiler test -pl pulsar-broker -Dtest=BrokerEntryCacheMultiBrokerTest
```
### Additional information
_No response_
### Are you willing to submit a PR?
- [x] I'm willing to submit a PR!
--
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.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Bug] Performance improvement opportunity in caching parsed message metadata [pulsar]
Posted by "lhotari (via GitHub)" <gi...@apache.org>.
lhotari closed issue #24644: [Bug] Performance improvement opportunity in caching parsed message metadata
URL: https://github.com/apache/pulsar/issues/24644
--
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