i18n_menu_menu_link_update() currently makes the menu_rebuild() operation (that is quite an expensive operation itself) about 17% slower.

So a 30s menu_rebuild() turns into a 35s menu_rebuild().

+ It adds 2 to 3 queries for each menu item, for a 1,250 item rebuild, that is 2,500 queries.

There's at least 2 ways to improve this method:

1) Only add to the $fields array the language field if it is us changing it's value.

2) Compare the new menu_link to the previous one to only trigger i18n_string_object_update() or i18n_string_object_remove() if relevant changes have been made to the menu_item.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

david_garcia’s picture

Status: Needs work » Needs review
FileSize
2.24 KB

Status: Needs review » Needs work

The last submitted patch, 1: 2511696-slow-menu-rebuild.patch, failed testing.

david_garcia’s picture

david_garcia’s picture

Just to make it compatible with current core and see if it passes tests. Without the patch in core no performance benefit.

david_garcia’s picture

Status: Needs work » Needs review
david_garcia’s picture

david_garcia’s picture

Status: Needs review » Needs work
david_garcia’s picture

Status: Needs work » Needs review
david_garcia’s picture

FileSize
2.31 KB

The last submitted patch, 4: 2511704-slow-menu-rebuild.patch, failed testing.

Status: Needs review » Needs work

The last submitted patch, 9: 2511696-slow-menu-rebuild.patch, failed testing.