Found via 📌 Optimize field module's hook_entity_bundle_info() implementation Active and roughly a similar problem.
When building bundle field definitions, we look for base field overrides for every bundle of every entity type. Some sites have several hundred bundles (custom blocks, paragraphs, webforms etc) and most sites have dozens.
However most sites only have a handful of base field overrides for one or two entity bundles.
This means we issue somewhere between dozens and several hundred entity queries during cache rebuilds, where 90-99% of them will return no results.
Instead, we can load all the base field overrides in one go, and static cache them on the class, then when we build the bundle field definitions, check that instead.
Active
11.0 🔥
entity system
It affects performance. It is often combined with the Needs profiling tag.