fuyou001 commented on PR #10640: URL: https://github.com/apache/rocketmq/pull/10640#issuecomment-5042318312
The per-thread scratch buffer approach looks reasonable, and the fallback for oversized messages avoids retaining an unexpectedly large buffer in the ThreadLocal.\n\nCould we add focused unit tests covering:\n\n- buffer allocation and reuse when processing multiple messages on the same thread;\n- buffer growth when a larger message is encountered;\n- the transient allocation path when the requested size exceeds the reuse cap;\n- corrupted inputs, particularly negative or otherwise invalid totalSize values.\n\nSince this is a performance-oriented change, could you also share benchmark results comparing the implementation before and after the change? It would be useful to include:\n\n- throughput and allocation rate;\n- GC frequency or pause time;\n- representative message sizes and thread counts;\n- benchmark duration, JVM version, heap settings, and methodology.\n\nIdeally, please include several message-size distributions, especially a workload with occasional messages exceeding the reuse cap. This would help quantify the improvement and verify that the ThreadLocal retention and oversized-message fallback behave as intended. -- 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]
