You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@seata.apache.org by "wt-better (via GitHub)" <gi...@apache.org> on 2024/08/03 10:43:43 UTC
[PR] optimize: deserialize performance optimize [incubator-seata]
wt-better opened a new pull request, #6727:
URL: https://github.com/apache/incubator-seata/pull/6727
<!-- Please make sure you have read and understood the contributing guidelines -->
- [ ] I have registered the PR [changes](../changes).
### Ⅰ. Describe what this PR did
1. deserialize performance optimize, avoid exceptions during deserialization
2. avoid array copy in deserialize
### Ⅱ. Does this pull request fix one issue?
<!-- If that, add "fixes #xxx" below in the next line, for example, fixes #97. -->
### Ⅲ. Why don't you add test cases (unit test/integration test)?
### Ⅳ. Describe how to verify it
test deserialize method performance
### Ⅴ. Special notes for reviews
--
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: notifications-unsubscribe@seata.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org
Re: [PR] optimize: deserialize performance optimize [incubator-seata]
Posted by "funky-eyes (via GitHub)" <gi...@apache.org>.
funky-eyes commented on code in PR #6727:
URL: https://github.com/apache/incubator-seata/pull/6727#discussion_r1703468622
##########
serializer/seata-serializer-seata/src/main/java/org/apache/seata/serializer/seata/SeataSerializer.java:
##########
@@ -172,11 +172,8 @@ private static <T> T deserializeByVersion(byte[] bytes, byte version) {
ByteBuffer byteBuffer = ByteBuffer.wrap(bytes);
//typecode
short typecode = byteBuffer.getShort();
- //msg body
- byte[] body = new byte[byteBuffer.remaining()];
- byteBuffer.get(body);
- ByteBuffer in = ByteBuffer.wrap(body);
- //new Messgae
+ ByteBuffer in = byteBuffer.slice();
Review Comment:
Why such a change?
--
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: notifications-unsubscribe@seata.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org
Re: [PR] optimize: deserialize performance optimize [incubator-seata]
Posted by "funky-eyes (via GitHub)" <gi...@apache.org>.
funky-eyes merged PR #6727:
URL: https://github.com/apache/incubator-seata/pull/6727
--
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: notifications-unsubscribe@seata.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org