Closed (fixed)
Project:
Drupal core
Version:
11.x-dev
Component:
entity system
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
9 Feb 2026 at 14:34 UTC
Updated:
15 Mar 2026 at 12:45 UTC
Jump to comment: Most recent
I'm doing some profiling on a site that is batch processing a lot of entities - it's trying to do around 4,000 per request for reasons and has to get several field values from each entity.
In this particular scenario, albeit one that's unusual, the calls to EntityDataDefinition::getDataType() and the functions that method calls account for about 800,000 out of 6 million function calls.
This is very easy to store on a property, so I think we should do that.
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
catchComment #4
heddnA small improvement and I can't think of any downsides.
Comment #5
longwaveTest failure looks relevant.
Comment #6
catchThe test failure is because the test is calling ::getDataType() on the first object, and not on the second, which meant the serialized versions were slightly different now that this affects the state of the object.
It would be possible to change the test, but there's no reason to serialize this - we can save the storage space if it ends up in cache, so implemented __sleep().
Since this is a very small change, restoring the RTBC.
Comment #7
longwaveCommitted and pushed efe749343bb to main and 54575357cd6 to 11.x. Thanks!