Need to index the menu tree
Arancaytar - June 3, 2009 - 08:01
In order to make DHTML Menu work reliably with other modules, I need an indexed/flat array for the entire menu tree, keyed by mlid. This will be expensive to build, and should be cached - but how do I know when to clear the cache?
hook_menu_alter() appears to be called only when the routers are rebuilt, but menu.module may alter custom links without rebuilding routers, and I need to rebuild the menu on that action as well. Any help?

Solved
Following the maxim of avoiding optimization until it is needed, I just re-index on every page load. I already have static caching, so the function only needs to run once per request. No noticable performance penalty.