Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
drupal_get_breadcrumb() can be expensive (can invokes various menu perm callbacks). We should avoid calling it unless necessary.
See patch.
Comment | File | Size | Author |
---|---|---|---|
menu_breadcrumb_perf.diff | 1.28 KB | dalin |
Comments
Comment #1
m4oliveiIs 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.
Comment #2
xurizaemonCleaning 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.