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

[ISSUE #11294] Optimize ConcurrentHashMap#computeIfAbsent have performance problem in jdk1.8 #11326

Merged
merged 4 commits into from
Jan 19, 2023

Conversation

mxsm
Copy link
Member

@mxsm mxsm commented Jan 18, 2023

What is the purpose of the change

Fix #11294

Brief changelog

  • Optimize ConcurrentHashMap#computeIfAbsent have performance problem in jdk1.8

Verifying this change

Checklist

  • 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.
  • 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.
  • Check if is necessary to patch to Dubbo 3 if you are work on Dubbo 2.7
  • 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.
  • Add some description to dubbo-website project if you are requesting to add a feature.
  • GitHub Actions works fine on your own branch.
  • If this contribution is large, please follow the Software Donation Guide.

@mxsm mxsm requested a review from AlbumenJ January 19, 2023 02:59
@mxsm
Copy link
Member Author

mxsm commented Jan 19, 2023

@AlbumenJ PTAL~

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

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.

Please fix style check.
image

@mxsm mxsm requested a review from AlbumenJ January 19, 2023 13:30
@mxsm
Copy link
Member Author

mxsm commented Jan 19, 2023

@AlbumenJ I has fixed it and re-submit again, PTAL~ Thks

@sonarqubecloud
Copy link

sonarqubecloud bot commented Jan 19, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 44 Code Smells

78.1% 78.1% Coverage
0.0% 0.0% Duplication

@codecov-commenter
Copy link

Codecov Report

Merging #11326 (4b6f548) into 3.2 (0c1b798) will decrease coverage by 4.69%.
The diff coverage is 84.00%.

@@             Coverage Diff              @@
##                3.2   #11326      +/-   ##
============================================
- Coverage     69.51%   64.83%   -4.69%     
+ Complexity      339       14     -325     
============================================
  Files          1514     1487      -27     
  Lines         81218    62360   -18858     
  Branches      14612     9133    -5479     
============================================
- Hits          56456    40429   -16027     
+ Misses        19950    17712    -2238     
+ Partials       4812     4219     -593     
Impacted Files Coverage Δ
...ache/dubbo/rpc/cluster/CacheableRouterFactory.java 0.00% <0.00%> (ø)
...o/rpc/cluster/router/script/ScriptStateRouter.java 0.00% <0.00%> (-73.34%) ⬇️
...enter/support/nacos/NacosDynamicConfiguration.java 33.80% <0.00%> (+0.14%) ⬆️
...gistry/client/ReflectionBasedServiceDiscovery.java 0.00% <0.00%> (ø)
...bo/registry/multiple/MultipleServiceDiscovery.java 0.00% <0.00%> (ø)
...o/registry/xds/util/protocol/AbstractProtocol.java 0.00% <0.00%> (ø)
...che/dubbo/common/utils/ConcurrentHashMapUtils.java 33.33% <33.33%> (ø)
...stry/client/ServiceDiscoveryRegistryDirectory.java 43.94% <50.00%> (-11.04%) ⬇️
...a/org/apache/dubbo/rpc/filter/AccessLogFilter.java 41.46% <66.66%> (-2.02%) ⬇️
...pache/dubbo/rpc/model/ModuleServiceRepository.java 66.66% <75.00%> (ø)
... and 515 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@AlbumenJ
Copy link
Member

Thanks for your contribution.

@AlbumenJ AlbumenJ merged commit d2eb0ef into apache:3.2 Jan 19, 2023
@mxsm mxsm deleted the dubbo-11294 branch January 20, 2023 01:48
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.

ConcurrentHashMap#computeIfAbsent have performance problem in jdk1.8
3 participants