While investigating performances issues on one of our site, I noticed that enabling the XML sitemap menu module was responsible for a time increase of about 40% for a single drush cc menu
command.
Tracing the issue, this is caused by xmlsitemap_menu_xmlsitemap_process_menu_links
be called to process (called from xmlsitemap_menu_menu_link_alter
) each menu item individually during menu rebuild.
I may be wrong, but there is little gain in immediate process of a menu link from a menu no used in the site map.
Would it make sense to only process menu items form menu actually in the sitemap. On our site, and I guess many other, it would greatly reduce the load during menu rebuild.