-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Optimize Node::getParent and usage in previews #33602
Conversation
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.
Clever :)
0897819
to
e292adc
Compare
One failure left
|
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 <jus@bitgrid.net>
Signed-off-by: Julius Härtl <jus@bitgrid.net>
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 <jus@bitgrid.net>
ea5bee3
to
83b1415
Compare
The only faikure now is the one about session that is unrelated |
Fix for the failing session test is in #33668 |
Node::getParent
does 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()