RockteMQ-AI commented on issue #10488: URL: https://github.com/apache/rocketmq/issues/10488#issuecomment-4689417614
**Issue Evaluation** Category: `type/enhancement` | Status: **Evaluated** **Feasibility:** Feasible **Scope:** `proxy` module — `GrpcConverter.buildMessage()` **Compatibility:** No breaking changes — `UnsafeByteOperations.unsafeWrap()` is a well-established protobuf pattern. Correct analysis. Since the source `byte[]` from `MessageExt.getBody()` is a standalone allocation that is not mutated after this point, `unsafeWrap()` avoids the redundant `System.arraycopy` without safety concerns. This is a standard optimization in gRPC/protobuf codepaths. **Note:** Ensure the `ByteString` lifecycle does not outlive the underlying `byte[]` — verify that the response is fully serialized before the source buffer is released/recycled. --- *Automated evaluation by RockteMQ-AI* -- 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]
