-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Conversation
Codecov Report
@@ 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
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
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
Motivation:
The efficiency is too low while doing list difference, when list size is 10000, it cost almost 4000ms.
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: