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 menu_rebuild() #3659
Optimize menu_rebuild() #3659
Conversation
…d or when the menus are rebuilt.
…ation_links_rebuild-performance
…ks in the middle of the test.
@hosef which issue does this PR refer to? |
…rs cause menu links to be deleted.
@indigoxela there isn't actually an issue. I initially wasn't even sure this would work. I just made the PR to see how the test bot would handle it. |
…ation_links_rebuild-performance
This PR says it optimizes |
@docwilmot |
@hosef great work, I'm impressed you were able to remove so many database queries (and surprised there were so many to remove!) I have one question, why were these tests removed? // Start over, forcefully delete child-1 from the database, simulating a
// database crash. Check that the children of child-1 have been reassigned
// to the parent, going up on the old path hierarchy stored in each of the
// links. |
@jenlampton Those tests were checking the behavior of the menu re-parenting when a different page uses a manual database query to remove a menu link in the middle of your page load. |
@hosef Does this change cause those tests to fail? If not, I'd prefer that we remove those tests in a separate issue where we can discuss why it was supported in the first place, just in case there's something else we're missing. Including that decision in an optimization issue might be setting us up for unforeseen consequences and it makes me nervous :) |
Those tests can't pass with the new code because they bypass the built in menu API functions, so they don't update the static cache used internally in menu_rebuild(). |
Ah ok! Let's see if other committers have any concerns. If not it's
probably worth the risk :)
…On Thu, Dec 23, 2021, 5:27 PM hosef ***@***.***> wrote:
Those tests can't pass with the new code because they bypass the built in
menu API functions, so they don't update the static cache used internally
in menu_rebuild().
—
Reply to this email directly, view it on GitHub
<#3659 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AADBERY5O6M2MC7CMTZXYF3USPEADANCNFSM5AC4V53Q>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Tugboat has finished building a preview for this pull request! Website: https://pr3659-uaathajauinc6qcrjnh2xjmjxi9vvsnu.tugboat.qa/ |
I've merged this into 1.x for inclusion in 1.21.0. Great work @hosef! |
Reducing the number of database queries used when a menu link is saved or when the menus are rebuilt.
Fixes backdrop/backdrop-issues#5389