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.

Comments

erikwebb’s picture

Status: Active » Needs review
StatusFileSize
new949 bytes

Whether 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_paths cache variable.

Status: Needs review » Needs work

The last submitted patch, 896570-cache--path-get-admin-paths.patch, failed testing.

erikwebb’s picture

Status: Needs work » Needs review
StatusFileSize
new976 bytes

Forgot to create diff from the root folder.

Status: Needs review » Needs work
Issue tags: -Performance

The last submitted patch, 896570-cache--path-get-admin-paths.patch, failed testing.

erikwebb’s picture

Status: Needs work » Needs review
Issue tags: +Performance
moshe weitzman’s picture

Status: Needs review » Closed (won't fix)

Any expensive code that runs in this hook can do its own caching IMO

plach’s picture

Status: Closed (won't fix) » Closed (duplicate)