EntityFieldManager::getFieldDefinitions() per-bundle caching can be expensive

Created on 24 July 2025, 9 days ago

Problem/Motivation

Spin-off from 📌 Optimize field module's hook_entity_bundle_info() implementation Active .

If you have a lot of bundles, which is often the case for sites with webform and/or paragraphs enabled, then the per-bundle cache on EntityFieldManager::getFieldDefinitions() can lead to hundreds of cache sets on cold cache requests.

With webform especially the number of fields per bundle is low (actually zero), so it might be possible to do something like cache the bundle definitions for all bundles of an entity type in one entry to reduce i/o. This could mean more data to load when it's requested, but that will usually happen on 'cool' caches (e.g. when dynamic page cache is empty) and might not be very measurable in that context, whereas the impact on fully site-blocking cold caches would be quite big.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

📌 Task
Status

Active

Version

11.0 🔥

Component

entity system

Created by

🇬🇧United Kingdom catch

Live updates comments and jobs are added and updated live.
  • Performance

    It affects performance. It is often combined with the Needs profiling tag.

Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024