Description

This is a follow-up to a few tickets, such as #17031. I could not find a duplicate. It is also tangentially related to #14134, which would be menus are affected to max post var settings.

Bottom line: saving navigation menus are slow. I was hoping to see that removing hierarchy ancestor cleaning in #11399 made a big improvement, but a 90-item flat menu still took 24 seconds and a few thousand queries to save. No me gusta.

I started chipping away at this giant list of queries, and came up with a number of changes across a number of areas of core to reduce them. The page now saves (and renders — it doesn't redirect) with only a few hundred queries — it's a lot, but considering a few queries per save, not bad — and just a few short seconds on my little MacBook Air that could.

Since these improvements are largely outside the menus API, I will be spawning individual tickets for most things.