That means, in my case where I noticed it, 18 identical cache get queries instead of one.
Patch coming in a second.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | system-list-cache-1969814-3.patch | 3.78 KB | berdir |
| #3 | system-list-cache-1969814-3-test-only.patch | 3.24 KB | berdir |
| #2 | drupal-1969814-2.patch | 1.83 KB | dawehner |
| #1 | system-list-cache-1969814-1.patch | 545 bytes | berdir |
Comments
Comment #1
berdirHere we go. If only every performance bug were as easily solved ;)
Comment #2
dawehnerThe fix looks perfect!
I tried to write a test, though it fails during the "installation", maybe you have an idea
Comment #3
berdirThank for starting the test. This seems to work, had to add a factory.
Comment #5
berdirComment #6
dawehnerThanks for making the test work!
needs strongs.
should be public
Comment #7
chx commentedI am hesitant on this one. Can we throw system_list out instead at least for modules? It is in the container, after all.
Comment #8
chx commentedI guess it's a go and #7 is a followup?
Comment #9
catchWhy is this being called 12 times?
In Drupal 7 only the bootstrap list has static caching (because in Drupal 6 the bootstrap list is actually queried twice - once for boot once for exit iirc), but unless something changed recently the bug doesn't exist in D7 and if anything 8.x should be calling it less rather than more.
Comment #10
berdirThe code in 7.x and 8.x of that function looks quite different, see http://api.drupal.org/api/drupal/includes%21module.inc/function/system_l...
In 7.x, it differentiated between called with type bootstrap, calling it multiple times with that argument would also lead to this bug and the "elseif (!isset($lists['module_enabled'])) {", which would then get the information from the cache.
I could do something similar and wrap the whole thing into an if and return at the end but that results in a bigger patch than this :) I'm fine with changing it...
Comment #11
catchWell it's more wondering why it's getting called so much at all - there's only about three places that call system_list() and those at least used to have their own static caches.
Comment #12
jibran#3: system-list-cache-1969814-3.patch queued for re-testing.
Comment #23
longwaveThis seems long obsolete, system_list() is gone and replaced with ModuleHandler and ThemeHandler, both of these cache their lists internally and do not regenerate them on every list call.