Closed (fixed)
Project:
Drupal core
Version:
7.x-dev
Component:
field system
Priority:
Normal
Category:
Task
Assigned:
Reporter:
Created:
2 Apr 2010 at 12:57 UTC
Updated:
18 Apr 2010 at 07:20 UTC
Jump to comment: Most recent file
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).
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | field_invoke_optimize.patch | 12.12 KB | yched |
| field_invoke_optimize.patch | 12.69 KB | yched |
Comments
Comment #1
yched commentedEasier tracking
Comment #2
yched commentedSlightly better, less memory occupation in field_attach_load().
Comment #3
moshe weitzman commentedThis function comes up as quite costly in my profiling of data migration. this looks like a great optimization. Bot is happy.
Comment #4
dries commentedGreat! Committed to CVS HEAD.