There's one field_info_fields() in the date_repeat_field() module which runs in a menu access callback, which I think means it's called on every page request. I've attached a patch so that the new field_info_field_map() can be used in Drupal >= 7.22.
There are two other field_info_fields() calls which do not run on every page request. Both of them are quickly followed by loops which require field info for every field, so it's probably valid usage.
Context
From Drupal 7.22, there is the field_info_field_map() function that is more lightweight. If no modules use field_info_fields() during a page request then performance benefits are likely. Change record: The Field API's memory usage has been optimized (includes recommended changes to contributed modules to leverage the changes). New documentation for field_info_fields(): http://api.drupal.org/api/drupal/modules%21field%21field.info.inc/functi...
Comment | File | Size | Author |
---|---|---|---|
#4 | date_repeat_field-1968828-4.patch | 2.05 KB | pjcdawkins |
Comments
Comment #0.0
pjcdawkins CreditAttribution: pjcdawkins commentedClarified.
Comment #0.1
pjcdawkins CreditAttribution: pjcdawkins commentedminor fix
Comment #1
Dave ReidYou need to use version_compare to compare these strings. A simple greater than operator is not the proper thing to use.
Comment #2
pjcdawkins CreditAttribution: pjcdawkins commentedRight, and my first patch looks really wrong. Here's a second attempt, with the addition of a function comment (because the original comment didn't seem to reflect what the function actually does).
Comment #3
podarok#2 looks good for me
Comment #4
pjcdawkins CreditAttribution: pjcdawkins commentedIt misses an efficiency: user_access() should be checked earlier. New patch attached.
Comment #6
podaroktests are broken
postponing this before tests fixed
Comment #7
vijaycs85#2167033: Fixing tests in 2014 is in...
Comment #8
vijaycs854: date_repeat_field-1968828-4.patch queued for re-testing.
Comment #9
podarokComment #10
vijaycs85Thanks, Committed 862434a and pushed to 7.x-2.x. Just needs update on issue summary about the user_access change...
Comment #11
vijaycs85