Attached patch refactors _field_invoke() and _field_invoke_multiple() :
- drops earlier if there is nothing to call for a given instance (field type module doesn't implement the corresponding hook_field_$op() hook)
- less array looping on languages
- less array looping on $instances in single-field mode
- as a side bonus, factors out code to determine the list of relevant instances to a helper _field_invoke_get_instances() function that filters according to the $options (do we want to operate on deleted fields as well, do we want to operate on a single field only).

Comments

yched’s picture

Assigned: Unassigned » yched

Easier tracking

yched’s picture

StatusFileSize
new12.12 KB

Slightly better, less memory occupation in field_attach_load().

moshe weitzman’s picture

Status: Needs review » Reviewed & tested by the community

This function comes up as quite costly in my profiling of data migration. this looks like a great optimization. Bot is happy.

dries’s picture

Status: Reviewed & tested by the community » Fixed

Great! Committed to CVS HEAD.

Status: Fixed » Closed (fixed)

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