I have a site with a large menu using the nice menu module and I noticed nice menu loads the full menu tree regardless of the depth selected on the block.

Is there any reason that line 465 of nice_menus.module couldn't change from:
$menu = isset($menu) ? $menu : menu_tree_all_data($menu_name);

TO:
$menu = isset($menu) ? $menu : menu_tree_all_data($menu_name, NULL, ($depth + 1));

Or something similar so that it only loads the required depth?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

maseyuk created an issue. See original summary.

maseyuk’s picture

Issue summary: View changes
jbabiak’s picture

Found this issue while trying to increase performance on site i'm working on that has a huge menu tree. I've tested this and found no negative effects and it does limit the depth that is loaded within theme_nice_menus_tree in nice_menus.module.

I've made the previous comments from maseyuk into a patch for the 7.x-3.x-dev branch.

Thanks maseyuk.

  • jbabiak authored 6d3bc52 on 7.x-2.x
    Issue #2900987 by jbabiak: Performance tweak
    
xiukun.zhou’s picture

fixd thanks

xiukun.zhou’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

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