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...

CommentFileSizeAuthor
#2 field_info_fields-1447400-2.patch1.44 KByched
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

merlinofchaos’s picture

Status: Needs review » Active

No patch attached. :(

yched’s picture

Status: Active » Needs review
FileSize
1.44 KB

Whoops. 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 ?

merlinofchaos’s picture

Status: Needs review » Fixed

Seems to work in testing. Committed and pushed.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.