Fix keep_while performance regressions#353
Merged
Merged
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## v0.17.x #353 +/- ##
===========================================
+ Coverage 86.39% 86.62% +0.22%
===========================================
Files 22 22
Lines 3477 3514 +37
===========================================
+ Hits 3004 3044 +40
+ Misses 473 470 -3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
[Why] When a tree uses `keep_while` conditions heavily, the previous implementation of `squash_version_bumps_after_keep_while()` was really expensive. This was due to the fact the for each modified node, we would loop over all entries of the `AppliedChanges` map to evaluate if the modified node got its `child_list_version` bumped twice. [How] Now, we handle this squash at the end of the handling of met `keep_while` conditions.
[Why] When there are many nodes delete because of an "expired" `keep_while` conditon, the previous implemention would walk the tree for each deleted tree node. This could be very expensive, even a waste of resources when deleted tree nodes were siblings or they would be automatically deleted because a parent was too. [How] Before looping over all the paths to delete, we convert them to patterns if possible. In other words, paths that are children of an already deleted parent are dropped and siblings are put together in a single pattern.
[Why] These new test cases verify the performance of `keep_while` handling after the previous two fixes. They only ensure there are no regressions. They do not verify correctness that much. Submitted by: Michal Kuratczyk (@mkuratczyk)
b75f834 to
b3dcbf7
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This branch fixes two performance issues related to
keep_whileconditions:keep_whileconditions-related changes are applied.See each commit for the full explanation.
The third commit adds a "testcase" that verifies the performance of
keep_whileconditions is ok.