I'm seeing this occasionally in New Relic:

And upon inspection find this:

The culprit seems to be the variable_delete('menu_rebuild_needed') call in subpathauto_url_inbout_alter():

/**
 * Implements hook_url_inbound_alter().
 */
function subpathauto_url_inbound_alter(&$path, $original_path, $language) {
  static $drupal_static_fast;

  if (!isset($drupal_static_fast)) {
    $drupal_static_fast['items'] = &drupal_static(__FUNCTION__, array());
  }

  $items = &$drupal_static_fast['items'];
  // If the current menu item exists at this path, then we should not continue
  // processing.
  if (empty($items[$path])) {
    $menu_rebuild_needed = variable_get('menu_rebuild_needed', FALSE);
    // In no cases rebuild the menu while trying to load the menu item here
    // since that would cause infinite loops if any module calls
    // drupal_get_normal_path() in hook_link_alter().
    variable_del('menu_rebuild_needed');
    $items[$path] = menu_get_item($path);
    if ($menu_rebuild_needed) {
      variable_set('menu_rebuild_needed', TRUE);
    }
  }
  if (!empty($items[$path]) && $items[$path]['href'] == $path) {
    return FALSE;
  }

  if ($source = subpathauto_lookup_subpath('source', $path, $original_path, $language)) {
    $path = $source;
  }
}

The first time I saw this I thought it was a random outlier, but I've now seen it multiple times, happening on normal page views.

Any thoughts?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

JordanMagnuson’s picture

I'm still seeing significant performance implications when using this module. Anyone else have data or input?

JordanMagnuson’s picture

Still an issue. Any thoughts son this?