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:

  1. 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;
      }
  2. 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;
      }
  3. Check access permissions against Workbench access rules.
  4. .

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?

CommentFileSizeAuthor
#3 2464969-wa-perf.patch858 bytesagentrickard
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

agentrickard’s picture

Category: Support request » Task
Status: Active » Needs work

That's actually a great idea.

  • agentrickard committed e2df65d on 7.x-1.x
    Issue #2464969 reported by jyraya: Workbench and performances
    
agentrickard’s picture

Status: Needs work » Fixed
FileSize
858 bytes
agentrickard’s picture

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.