wang-jiahua opened a new pull request, #10971: URL: https://github.com/apache/rocketmq/pull/10971
### Which Issue(s) This PR Fixes Fixes #10969 ### Brief Description In `PullAPIWrapper#processPullResult`, the per-message loop calls `Long.toString(pullResult.getMinOffset())` and `Long.toString(pullResult.getMaxOffset())` for every message, although both values are constant within one pull response. A 32-message batch allocates 64 identical short-lived strings where 2 suffice, on every pull response of every push/pull consumer. This PR hoists the two `Long.toString` calls out of the loop and reuses the two strings for the whole batch. No behavior change: property values are identical and `putProperty` semantics are untouched. ### How Did You Test This Change? - `PullAPIWrapperTest` passes (11/11). - Joint A/B benchmark on a 4-node cluster (producer 64 threads + consumer 20 threads, 1 KiB body; only the consumer-side client jar swapped per arm; 3 interleaved 60 s trials): consumer young GC per million consumed messages 1.10/1.06/1.17 (base) vs 1.08/1.06/1.07 (patch), consume TPS flat — no regression. The saving itself is tens of short-lived strings per batch, below GC-count resolution; this is a cleanup-level optimization on a hot path. -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
