-
Notifications
You must be signed in to change notification settings - Fork 8.7k
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
optimize: opt codes related to Map
and List
#3134
optimize: opt codes related to Map
and List
#3134
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #3134 +/- ##
=============================================
+ Coverage 50.45% 50.48% +0.03%
- Complexity 3108 3134 +26
=============================================
Files 593 593
Lines 19571 19512 -59
Branches 2427 2413 -14
=============================================
- Hits 9874 9851 -23
+ Misses 8702 8682 -20
+ Partials 995 979 -16
|
Map
config/seata-config-nacos/src/main/java/io/seata/config/nacos/NacosConfiguration.java
Show resolved
Hide resolved
config/seata-config-zk/src/main/java/io/seata/config/zk/ZookeeperConfiguration.java
Show resolved
Hide resolved
Map
Map
and List
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.
computeIfAbsent can guarantee atomic?
If the |
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.
LGTM
…-map-code # Conflicts: # spring/src/main/java/io/seata/spring/annotation/datasource/DataSourceProxyHolder.java
Codecov Report
@@ Coverage Diff @@
## develop #3134 +/- ##
=============================================
+ Coverage 50.53% 50.58% +0.05%
- Complexity 3144 3161 +17
=============================================
Files 598 598
Lines 19774 19698 -76
Branches 2467 2441 -26
=============================================
- Hits 9993 9965 -28
+ Misses 8779 8745 -34
+ Partials 1002 988 -14
|
…-map-code # Conflicts: # integration/http/src/main/java/io/seata/integration/http/AbstractHttpExecutor.java
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.
LGTM
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.
LGTM
Ⅰ. Describe what this PR did
optimize: opt codes related to
Map
andList
.优化
Map
和List
相关的代码(因为有人吐槽阿里(seata)的开发人员基础差,orz)优化后的效果:
Map
的computeIfAbsent
方法,保证了操作原子性,减少了并发下的重复初始化操作。Ⅱ. Does this pull request fix one issue?
Ⅲ. Why don't you add test cases (unit test/integration test)?
Ⅳ. Describe how to verify it
Ⅴ. Special notes for reviews