Skip to content
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

[More Optimize]Heartbeat skip serialize and deserialize #7168

Merged
merged 6 commits into from
Feb 8, 2021
Merged

[More Optimize]Heartbeat skip serialize and deserialize #7168

merged 6 commits into from
Feb 8, 2021

Conversation

zhangyz-hd
Copy link
Contributor

What is the purpose of the change

#7077 基础上进一步优化,使用ThreadLocal<byte[]> 降低每次读取event的payload的内存开销。

Brief changelog

增加静态成员ThreadLocal<byte[]>,当读取event的payload时,获取当前NIO线程对应的byte[],避免每次读取payload都要分配byte[]。
NIO线程有限(DUBBO默认CPU+1),ThreadLocal内byte[]有限。

Follow this checklist to help us incorporate your contribution quickly and easily:

  • Make sure there is a GITHUB_issue field for the change (usually before you start working on it). Trivial changes like typos do not require a GITHUB issue. Your pull request should address just this issue, without pulling in other changes - one PR resolves one issue.
  • Format the pull request title like [Dubbo-XXX] Fix UnknownException when host config not exist #XXX. Each commit in the pull request should have a meaningful subject line and body.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Write necessary unit-test to verify your logic correction, more mock a little better when cross module dependency exist. If the new feature or significant change is committed, please remember to add sample in dubbo samples project.
  • Run mvn clean install -DskipTests=false & mvn clean test-compile failsafe:integration-test to make sure unit-test and integration-test pass.
  • If this contribution is large, please follow the Software Donation Guide.

@zhangyz-hd zhangyz-hd changed the title [Optimize]Heartbeat skip serialize and deserialize [More Optimize]Heartbeat skip serialize and deserialize Feb 3, 2021
@chickenlj
Copy link
Contributor

LGTM

@codecov-io
Copy link

codecov-io commented Feb 3, 2021

Codecov Report

Merging #7168 (449c33b) into master (f4b225e) will decrease coverage by 0.39%.
The diff coverage is 66.66%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #7168      +/-   ##
============================================
- Coverage     60.01%   59.61%   -0.40%     
+ Complexity      289      287       -2     
============================================
  Files          1001     1001              
  Lines         39994    39999       +5     
  Branches       5941     5942       +1     
============================================
- Hits          24002    23846     -156     
- Misses        13290    13444     +154     
- Partials       2702     2709       +7     
Impacted Files Coverage Δ Complexity Δ
.../apache/dubbo/remoting/transport/CodecSupport.java 80.00% <66.66%> (-2.00%) 0.00 <0.00> (ø)
...ava/org/apache/dubbo/rpc/cluster/Configurator.java 4.00% <0.00%> (-32.00%) 0.00% <0.00%> (ø%)
...figcenter/file/FileSystemDynamicConfiguration.java 31.42% <0.00%> (-31.43%) 0.00% <0.00%> (ø%)
...bo/rpc/cluster/support/FailbackClusterInvoker.java 52.45% <0.00%> (-14.76%) 0.00% <0.00%> (ø%)
...che/dubbo/remoting/transport/mina/MinaChannel.java 39.47% <0.00%> (-10.53%) 15.00% <0.00%> (-1.00%)
...e/dubbo/remoting/transport/netty4/NettyClient.java 60.86% <0.00%> (-10.15%) 0.00% <0.00%> (ø%)
...o/remoting/transport/ChannelHandlerDispatcher.java 60.00% <0.00%> (-10.00%) 0.00% <0.00%> (ø%)
.../apache/dubbo/remoting/transport/AbstractPeer.java 58.69% <0.00%> (-8.70%) 0.00% <0.00%> (ø%)
...dubbo/remoting/exchange/support/DefaultFuture.java 84.61% <0.00%> (-5.13%) 0.00% <0.00%> (ø%)
...e/dubbo/remoting/transport/netty/NettyChannel.java 52.27% <0.00%> (-3.41%) 19.00% <0.00%> (-1.00%)
... and 20 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f4b225e...449c33b. Read the comment docs.

Copy link
Member

@AlbumenJ AlbumenJ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@AlbumenJ AlbumenJ merged commit 75f04bf into apache:master Feb 8, 2021
@zhangyz-hd zhangyz-hd deleted the heartbeat_skip_serialize_and_deserialize branch February 19, 2021 05:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants