History
In Drupal 6 there were big changes with the menu_router system. As far as I can tell, it was a performance based decision. It was a time of low performance (compare to SSD) SATA drives. So storing router items in the database was a good idea, due to better performance. But it was not fast enough. menu_local_tasks started to be stored in cache_menu (per tab_root) Actions were added in Drupal 7 and were stored in cache_menu as well. Backdrop added context_links but this data was not cached. As a result, there was around +10% response time added to each page.
Ideas in patch
My first assumption based on SSD popularity. There is no significant performance difference between a reading file and selecting a record from the database.
Menu_router is hierarchy based data. Instead of selecting the database to match path variable, I decided to read JSON file by path.
Tabs, actions and context items can be prepared on menu_rebuild phase. I added tabs.json, action.json and context.json files. It's kinda a cache that updates on menu_rebuild call.
Result
- no significant changes on tests performance.
- some performance boost when context links are in use. But not big one.
- no need to cache local_tasks anymore, as a result, there is less pressure on cache_menu table and fewer queries per page request.
- step forward to remove MENU_MAX_PARTS (9) limitation.
Backward compatibility
I did not remove _menu_router_save() function. menu_rebuild call it to update menu_router table. Any contrib module that requires records from menu_router table is not going to be broken.
Need help & review
I am not good with documentation and function name. Please help me to properly update documentation and rename functions.
Recent comments
This was tricky, so i tried to stay minimal and try to snatch the very first procedure after file upload and inject rehashing there. The file is tinymce.pages.inc under the function...
File hashing uploads made through TinyMCE
Bee's great. But if you don't want to install bee, or can't, or you already have a bunch of scripts you're used to using in D7, then the method I posted is quick and easy and all you really...
How to create a command-line (cli) routine or script (bee not required)
Or you can install bee, get the benefit of all the included functions and either include your script using: bee php-script ../my-scripts/scratch.php https://github.com/backdrop-...
How to create a command-line (cli) routine or script (bee not required)