Problem/Motivation
These are requested multiple times on cold caches, the class already has a static cache for the entity definitions.
While this is in chained fast, on a fully cold cache request, chained fast doesn't kick in yet (any other cache set invalidates the cache, and we have an explicit warm-up time after #3526080: Reduce write contention to the fast and consistent backend in ChainedFastBackend.
Steps to reproduce
NA
Proposed resolution
Setting a protected variable entityFieldStorageDefinitions to store the entity definition vs doing cache lookup everytime.
Remaining tasks
User interface changes
NA
Introduced terminology
NA
API changes
NA
Data model changes
NA
Release notes snippet
NA
Issue fork drupal-3564969
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
- 3564969-static-cache-field
changes, plain diff MR !14179
Comments
Comment #2
catchComment #6
smustgrave commentedRe-ran the tests 3 times but they are green. Some media test just didn't want to play along.
Tried to update the summary best I could but may need a tweak. But performance reduction speaks for itself.
Comment #7
alexpottNeeds a reroll because there are MR conflicts.
Comment #8
catchRebased.
Comment #9
alexpottThis MR is causing failures in
core/modules/media/tests/src/FunctionalJavascript/MediaSourceFileTest.phpand another JS test somehow... reproduced the fails locally.Comment #10
alexpottI think we're missing a static cache reset in \Drupal\Core\Entity\EntityLastInstalledSchemaRepository::deleteLastInstalledDefinition
Comment #11
catchBack to green. I switched from = NULL to unset() which doesn't do anything but looks nicer to me, and added an unset where it was missing.
Comment #12
alexpottCommitted and pushed 43a14ed5f0c to main and 8b9a7e5d8a6 to 11.x. Thanks!