Working on #1040790: _field_info_collate_fields() memory usage, which aims at lowering the memory footprint of the field_info_*() functions in D8 and D7.
I grepped through the usage of the (memory intensive) field_info_instances() function in a couple big contrib modules.
Attached is a version of ctools_entity_from_field_get_children() that relies on field_info_fields() rather than field_info_instances()
Right now every field_info_*() functions reads from a huge static array, so field_info_fields() and field_info_instances() have the same memory cost. If the patch in #1040790: _field_info_collate_fields() memory usage gets in (and backported), field_info_fields() will be much more memory-friendly than field_info_instances() - although the latter won't become worse than in current D7.
The code should be strictly equivalent, but I didn't test my changes for typos / var renames...
Comment | File | Size | Author |
---|---|---|---|
#2 | field_info_fields-1447400-2.patch | 1.44 KB | yched |
Comments
Comment #1
merlinofchaos CreditAttribution: merlinofchaos commentedNo patch attached. :(
Comment #2
yched CreditAttribution: yched commentedWhoops. And I removed my local copy meanwhile :-(.
Here it is. As stated above, this should be semantically equivalent, but this is not actually tested for typos / var renames.
This changes the order in which the resulting $plugins array is populated, but that shouldn't matter ?
Comment #3
merlinofchaos CreditAttribution: merlinofchaos commentedSeems to work in testing. Committed and pushed.