-
-
Notifications
You must be signed in to change notification settings - Fork 153
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
Fix: Improve performance of content destination collision detection. #388
Fix: Improve performance of content destination collision detection. #388
Conversation
Codecov Report
@@ Coverage Diff @@
## master #388 +/- ##
=======================================
Coverage 64.66% 64.67%
=======================================
Files 14 14
Lines 1834 1826 -8
=======================================
- Hits 1186 1181 -5
+ Misses 512 509 -3
Partials 136 136
Continue to review full report at Codecov.
|
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
I added a commit that removes the duplicate |
amazing! thanks! |
This PR fixes #387 and #393 by reducing the algorithmic complexity of the content destination collision detection. Previously when appending an element, the destination was compared to all other elements in the content list. Now we simply append and check for collisions once at the end with a single pass through all elements.
For 150000 files with random destinations, the performance compares as follows:
That's a 320x improvement from 50 minutes to 9 seconds for extreme use cases!
Here's the benchmark code:
Thank you @mjmjelde for reporting this.