Let me preface this by saying there might be nothing we can do here due to core.
Every request to /admin/config causes hook_requirements('runtime') to be invoked. Metatag then calls system_rebuild_module_data() which adds significant time to the request because it only uses static caching and forces a scan of the site modules.
I'm wondering if we can rework this requirements check or use caching to prevent this from firing on ever request. Perhaps using module_list or system_get_info instead or use caching to help. I wanted to get feedback before jumping into writing a patch :)
I'm including a Blackfire.io timeline to show what I'm talking about.
Comments
Comment #2
andyg5000Comment #3
andyg5000If
system_get_info('module')is sufficient, I'm getting almost 500% savings calling that instead. However Damien may have good reason for complete re-scan!Comment #4
andyg5000Comment #5
damienmckennaExcellent point, thanks for digging into this.
Here's a patch with the change you suggested.
Comment #6
andyg5000Sorry, I didn't mean to insinuate that those methods were interchangeable :) The return different things, so we'd need to update the logic that follows as well. For example, we're checking schema version on one of them and that isn't returned by system_get_info().
Comment #7
damienmckennaDuh (-:
Some of the version checking could be replaced with checking to see if there's a specific update script in the module's install file.
Comment #8
lolandese commentedFor the GIT Info Report module (D8) I encountered the same issue. As I was fine with the code running only on the Status report, it was solved easily just adding a conditional to see if the current route is system.status.
See #3093404: Code seems to run on 'admin/config' as well.
Comment #9
damienmckennaApologies, this was duplicated in #3109898: metatag_requirements() loads slowly due to system_rebuild_module_data() which was committed recently.