Hello,
We are working on a huge Drupal application containing hundreds contents that contain themselves related contents (Entity reference).
We are working on performances and we have activated different caching modules, with Varnish and memcache.
Nevertheless, we're facing some performance issues with authenticated users on content view actions.
By analyzing processes that could be time consuming, we noticed that the hook_node_access implementation of "workbench access" module was amongst the most time consumers.
Investigating in the hook code, I saw that it does the following process:
- Load the workbench access active tree and check if the active part is empty or not. If empty, it returns "NODE_ACCESS_IGNORE".
// If not configured, do nothing. $tree = workbench_access_get_active_tree(); if (empty($tree['active'])) { return NODE_ACCESS_IGNORE; }
- Check if the content is viewed and its status is 1 (published). If it is the case, it returns "NODE_ACCESS_IGNORE".
// View step. We ignore for published nodes. if ($op == 'view' && $node->status) { return NODE_ACCESS_IGNORE; }
- Check access permissions against Workbench access rules.
.
I made a patch switching the order of steps 1 and 2, I observed significant performance improvements on the hook time consuming.
I would like to know why we need to perform the tree active checking at first place if we return "NODE_ACCESS_IGNORE" anyway when the content is viewed and published?
Could we apply a patch as I made in order to improve hook performance?
Comment | File | Size | Author |
---|---|---|---|
#3 | 2464969-wa-perf.patch | 858 bytes | agentrickard |
Comments
Comment #1
agentrickardThat's actually a great idea.
Comment #3
agentrickardComment #4
agentrickard