Fixed
Project:
Drupal core
Version:
11.x-dev
Component:
entity system
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
28 Apr 2026 at 16:46 UTC
Updated:
28 Apr 2026 at 23:46 UTC
Jump to comment: Most recent
Comments
Comment #2
alexpottThis is reminding me of #3131585: Performance regression caused by using the last installed entity definitions
Comment #3
alexpottHere's a @longwave thought - how storing them in state but caching them on disk so they can be opcached?
Comment #5
catchComment #6
catchComment #7
catchWe need to invalidate them when schema definitions are updated, which means they need to be consistent across multiple web heads. Discovery cache is already chained fast so gets are from APCu.
Comment #8
amateescu commentedLooks great to me!
Comment #9
catchLooking back at #3131585: Performance regression caused by using the last installed entity definitions I think this is more or less a direct follow-up of that issue .
The way it's implemented now, to get the entity definitions we also load the field definitions, but then throw them away, then they're separately got and cached when field definitions for an individual entity type are requested.
The individual cache items for field storage definitions make sense to save loading everything in the 'cool cache' state when only some might be needed.
This is also covered by performance tests - when I wasn't writing back to the persistent cache in earlier iterations, it was just moving those writes from the completely cold to less cold requests. When we write back with ::setMultiple() it's neutral for the 'cool' cases but still an improvement for the cold case.
Comment #10
alexpottCommitted e385751 and pushed to main. Thanks!
We need a new MR for 11.x
Comment #13
catchAdded a backport MR - only performance test numbers changed so back to RTBC.
Comment #15
alexpott