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.
It's only caching newly found hooks if they have an implementation, leading to those hooks being rechecked again on every request. With a decent number of modules enabled this is 5% of every request being wasted, and it's a one line fix, so marking critical/major.
Comment | File | Size | Author |
---|---|---|---|
module_implements_cache.patch | 1.27 KB | catch | |
Comments
Comment #1
Stevel CreditAttribution: Stevel commentedLooks good.
Comment #2
webchickNice catch, catch! ;)
Quick question: Is it possible to write tests for this?
Comment #3
Dries CreditAttribution: Dries commentedCommitted to CVS HEAD. Lowering priority and updating tags. Good catch, catch.
Comment #4
marcingy CreditAttribution: marcingy commentedBumping back up in priority and reseting status as this doesn't appear to have been committed.
Comment #5
Dries CreditAttribution: Dries commentedCommitted to CVS HEAD. Thanks.
Comment #6
marcingy CreditAttribution: marcingy commentedAnd setting back to open and normal now we need tests.
Comment #7
catchI think it's just about possible to write tests:
* Have two page callbacks.
* One doesn't invoke any hooks.
*One does invoke some hooks that don't have any implementations
* Visit both pages in order, on visiting the second page, do a raw cache_get() of the module_implements() cache and ensure that the hooks with no implementations are in there.
Comment #8
marcingy CreditAttribution: marcingy commentedChanging to major as per tag.
Comment #9
MustangGB CreditAttribution: MustangGB commentedTag update
Comment #10
catchDowngrading, adding tests doesn't meet the criteria for major.