Coming from #2313875: Preserve the 'field_type' within FieldInstanceConfig, which tracks the places where we load FieldStorageDefinition objects while in the "ideal" critical path of "entity render with entity cache and render cache hits".
On node/[nid], EntityViewController::view() (page controller for "full entity" pages) does an explicit $entity->title->view('full'), to extract the entity title as page title.
This currently triggers full instantiation of the FieldItemList objects (which in turn requires loading the FieldStorageDefinition objects) for *all* the fields in the entity, just because EntityViewBuilder() does a foreach($entity) to iterate on the fields present in the entity.
This could be avoided alltogether if we iterated on $entity->getFieldDefinitions() instead.
Comment | File | Size | Author |
---|---|---|---|
#1 | 2314359-optimize_EVB_viewField-1.patch | 776 bytes | yched |
Comments
Comment #1
yched CreditAttribution: yched commentedPatch.
Comment #2
amateescu CreditAttribution: amateescu commentedIf we never use $items in that foreach loop, the patch looks good.
Comment #3
webchickCommitted and pushed to 8.x. Thanks!