path_get_admin_paths() is executed at each (non-cached) page view. As it involves a module_invoke_all() call which implementations may be relatively heavy (preg matches and so on), IMO it could db-cache the result. Unless obviously the result may vary at each request which I don't think.
I'll try to provide a patch and some benchmarks asap.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | 896570-cache--path-get-admin-paths.patch | 976 bytes | erikwebb |
| #1 | 896570-cache-path-get-admin-paths.patch | 949 bytes | erikwebb |
Comments
Comment #1
erikwebb commentedWhether this is a significant improvement or not, I'll leave that up to someone more knowledgeable. I've attached a patch to add a new
path:admin_pathscache variable.Comment #3
erikwebb commentedForgot to create diff from the root folder.
Comment #5
erikwebb commented#3: 896570-cache--path-get-admin-paths.patch queued for re-testing.
Comment #6
moshe weitzman commentedAny expensive code that runs in this hook can do its own caching IMO
Comment #7
plachMarking duplicate of #1032700: Add caching to hook_admin_paths().