drupal_get_breadcrumb() can be expensive (can invokes various menu perm callbacks). We should avoid calling it unless necessary.

See patch.

CommentFileSizeAuthor
menu_breadcrumb_perf.diff1.28 KBdalin

Comments

m4olivei’s picture

Is that really a performance improvement? If you look at the code in drupal_get_breadcrumb() it calls drupal_set_breadcrumb() to get the data and that function does the heavy lifting once, storing the result in a static variable which is returned on subsequent calls.

So no matter how many times you call drupal_get_breadcrumb() the performance hit after the first time is next to nill.

xurizaemon’s picture

Issue summary: View changes
Status: Needs review » Closed (outdated)

Cleaning up issue queue. Closing all D6 issues.

If you believe this issue still applies to a supported version, feel free to re-open it. That would be a great time to check if the issue contains clear steps for reproducing the bug!

Thanks and sorry for any inconvenience.