Spin-off from 🐛 \Drupal\user\ContextProvider\CurrentUserContext::onBlockActiveContext() loads the anonymous user Postponed: needs info and possibly/hopefully 📌 Load user entity in Cookie AuthenticationProvider instead of using manual queries Needs work .
PHP 8.4 introduced property hooks, this allows logic to run when class properties are get and set.
In ContentEntityBase::__construct() we set the the $entityKeys and $translatableEntityKeys properties based on field definitions - this requires fetching field definitions in cases where they might not be used.
I haven't actually used property hooks yet, but I think it would be possible to move all of that logic to the first time either one of those properties is accessed while maintaining full bc. We'd have to defer setting the bundle entity key too but that seems very doable.
Active
11.0 🔥
entity system
It affects performance. It is often combined with the Needs profiling tag.