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

improve efficiency of list difference #1241

Merged
merged 3 commits into from
Sep 25, 2022

Conversation

nocvalight
Copy link
Member

@nocvalight nocvalight commented Sep 7, 2022

Motivation:

The efficiency is too low while doing list difference, when list size is 10000, it cost almost 4000ms.
image

Modification:

Use set difference instead of list difference.

Result:

SetDifference is 100 times more efficient than ListDifference, with a little more temporary memory allocation.

BenchMark result:
image

image

@sofastack-bot sofastack-bot bot added cla:yes CLA is ok First-time contributor First-time contributor size/L labels Sep 7, 2022
core/api/pom.xml Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Sep 13, 2022

Codecov Report

Merging #1241 (e26141f) into master (169016c) will increase coverage by 0.06%.
The diff coverage is 96.66%.

@@             Coverage Diff              @@
##             master    #1241      +/-   ##
============================================
+ Coverage     72.04%   72.11%   +0.06%     
- Complexity      779      780       +1     
============================================
  Files           410      411       +1     
  Lines         17376    17404      +28     
  Branches       2703     2710       +7     
============================================
+ Hits          12519    12551      +32     
+ Misses         3475     3469       -6     
- Partials       1382     1384       +2     
Impacted Files Coverage Δ
.../java/com/alipay/sofa/rpc/common/RpcConstants.java 100.00% <ø> (ø)
.../main/java/com/alipay/sofa/rpc/common/Version.java 100.00% <ø> (ø)
...m/alipay/sofa/rpc/common/struct/SetDifference.java 96.15% <96.15%> (ø)
...ay/sofa/rpc/client/AllConnectConnectionHolder.java 60.76% <100.00%> (+0.25%) ⬆️
...ipay/sofa/rpc/codec/bolt/SofaRpcSerialization.java 76.19% <100.00%> (+0.17%) ⬆️
.../alipay/sofa/rpc/common/struct/ListDifference.java 93.10% <0.00%> (-3.45%) ⬇️
...om/alipay/sofa/rpc/server/triple/TripleServer.java 74.86% <0.00%> (-1.07%) ⬇️
...java/com/alipay/sofa/rpc/module/LookoutModule.java 85.71% <0.00%> (+33.33%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@EvenLjj EvenLjj added this to the 5.9.0 milestone Sep 13, 2022
Copy link
Collaborator

@EvenLjj EvenLjj 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
Collaborator

@chuailiwu chuailiwu left a comment

Choose a reason for hiding this comment

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

LGTM

@EvenLjj EvenLjj merged commit dd60483 into sofastack:master Sep 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla:yes CLA is ok First-time contributor First-time contributor size/L
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants