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.

CommentFileSizeAuthor
message-use-plugin-cache.patch525 bytesmsonnabaum
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Grayside’s picture

Category: feature » bug
Priority: Normal » Major
Status: Active » Needs review
Issue tags: +Performance

This is clearly a bug. Good catch, I never double checked that. Should help a lot since I have dozens of message types.

Grayside’s picture

Status: Needs review » Needs work

Applied 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.

warning: call_user_func() expects parameter 1 to be a valid callback, function 'message_plugin_user_accessible_ids' not found or invalid function name in /home/abr/Workspace/d6/sites/all/modules/contrib/message/message.module on line 597.
warning: call_user_func() expects parameter 1 to be a valid callback, function 'message_plugin_role_accessible_ids' not found or invalid function name in /home/abr/Workspace/d6/sites/all/modules/contrib/message/message.module on line 597.
bluegeek9’s picture

Issue summary: View changes
Status: Needs work » Closed (won't fix)