-
Notifications
You must be signed in to change notification settings - Fork 11.9k
[ISSUE 3585] [Part B] Improve encode/decode performance #3588
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
areyouok
commented
Dec 6, 2021
- [Part B] Improve header encode/decode performance
- [Part B] Improve RocketMQSerializable performance with zero-copy
remoting/src/main/java/org/apache/rocketmq/remoting/protocol/FastCodesHeader.java
Show resolved
Hide resolved
…ero-copy; fix securtiy problems.
common/src/main/java/org/apache/rocketmq/common/protocol/header/SendMessageResponseHeader.java
Show resolved
Hide resolved
common/src/test/java/org/apache/rocketmq/common/protocol/header/FastCodesHeaderTest.java
Outdated
Show resolved
Hide resolved
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #3588 +/- ##
=============================================
- Coverage 48.18% 48.06% -0.12%
+ Complexity 5048 5047 -1
=============================================
Files 636 637 +1
Lines 42506 42637 +131
Branches 5568 5605 +37
=============================================
+ Hits 20483 20495 +12
- Misses 19545 19627 +82
- Partials 2478 2515 +37 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In request or response header, some Integer
fields(queueId, sysFlag, etc) are assigned by java.lang.Integer#parseInt(java.lang.String)
. Is it more appropriate to use java.lang.Integer#valueOf(java.lang.String)
to prevent auto-boxing? valueOf()
will use IntegerCache
, but the behavior of auto-boxing depends on the implementation of compiler.
The java 8 compiler use Integer.valueOf(Integer) for auto-boxing, frequently requested values is caching. By the way, the rocketmq header objects should use primitive types, but I do not change this time. |
Support go ahead. |
* [ISSUE 3585] [Part B] Improve header encode/decode performance * [ISSUE 3585] [Part B] Improve RocketMQSerializable performance with zero-copy; fix securtiy problems. * [ISSUE 3585] [Part B] Fix unit test Co-authored-by: yuz10 <845238369@qq.com>