Optimize Node::getParent and usage in previews#33602
Merged
juliusknorr merged 3 commits intomasterfrom Aug 25, 2022
Merged
Conversation
icewind1991
approved these changes
Aug 18, 2022
nickvergessen
approved these changes
Aug 18, 2022
0897819 to
e292adc
Compare
1 task
Merged
Member
|
One failure left
|
Merged
Member
Author
|
Tests revealed an additional issue for cases where we cannot just pass the current node as parent, e.g. if |
Signed-off-by: Julius Härtl <[email protected]>
Signed-off-by: Julius Härtl <[email protected]>
As the user folder might be initialized by the root from two levels down the hierarchy, passing this as a parent only works if the path matches Signed-off-by: Julius Härtl <[email protected]>
ea5bee3 to
83b1415
Compare
Member
|
The only faikure now is the one about session that is unrelated |
Member
Author
|
Fix for the failing session test is in #33668 |
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.
Node::getParentdoes not need to query the database again if the parent node was already used before for constructing the child node. In those cases it is now passed to the child node and can be reused.The second commit avoids using the getParent call on preview generation which saves one query.
Found in Collectives where there are similar optimisations, but this would be a generic use to help prevent this for users of getParent()