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.
Message's implementation of hook_ctools_plugin_plugins doesn't set cache => true, so it defaults to false.
Because of this, every time ctools_get_plugins() is called from message_get_plugin_messages(), it calls ctools_plugin_load_includes() which rebuilds the plugin cache. Considering that message_get_plugin_messages() gets called in message_show_message(), this doesn't seem like the desired behavior.
Attached patch sets cache to true, which solves the issue for me.
Comment | File | Size | Author |
---|---|---|---|
message-use-plugin-cache.patch | 525 bytes | msonnabaum | |
Comments
Comment #1
Grayside CreditAttribution: Grayside commentedThis is clearly a bug. Good catch, I never double checked that. Should help a lot since I have dozens of message types.
Comment #2
Grayside CreditAttribution: Grayside commentedApplied patch. I see a speed gain of roughly 2ms per page load.
However, some processing step appears to be missed on cached plugins, possibly the inclusion of the message plugin files.
Comment #3
bluegeek9 CreditAttribution: bluegeek9 as a volunteer commented