While working on a large data import, I discovered that alias_hierarchy was slowing node saves down from less than a second to up to 6 seconds. I tracked this down to the hook_node_update implementation, which always calls menu_rebuild() even if it doesn't do anything.

Attached is a patch that should speed it up, but I'm not sure I've captured all possible instances when the rebuild is required.

Comments

lambic’s picture

StatusFileSize
new2.05 KB
iwayman’s picture

Thanks lambic. Your patch does speed up things. It just needs a little fix to make sure that the regenerate function gets called:

$updated = alias_hierarchy_regenerate_pathauto_alias() || $updated

instead of:
$updated = $updated || alias_hierarchy_regenerate_pathauto_alias()

Tests are good, I'll commit them changes shortly.

  • iwayMan committed 2a86324 on 7.x-1.x authored by lambic
    Issue #2455485 by lambic, iwayMan: Rebuild menu only when alias has...
iwayman’s picture

Status: Active » Fixed

Patch has been deployed. Closing issue. Thanks for your help.

iwayman’s picture

Status: Fixed » Closed (fixed)