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

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

pjcdawkins’s picture

Issue summary: View changes

Clarified.

pjcdawkins’s picture

Issue summary: View changes

minor fix

Dave Reid’s picture

Issue summary: View changes
Status: Needs review » Needs work
+++ b/date_repeat_field/date_repeat_field.module
@@ -119,12 +119,15 @@ function date_repeat_field_permission() {
+  $field_map = VERSION >= '7.22' ? field_info_field_map() : field_info_fields();

You need to use version_compare to compare these strings. A simple greater than operator is not the proper thing to use.

pjcdawkins’s picture

Status: Needs work » Needs review
FileSize
2 KB

Right, 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).

podarok’s picture

Status: Needs review » Reviewed & tested by the community

#2 looks good for me

pjcdawkins’s picture

Status: Reviewed & tested by the community » Needs review
FileSize
2.05 KB

It misses an efficiency: user_access() should be checked earlier. New patch attached.

Status: Needs review » Needs work

The last submitted patch, 4: date_repeat_field-1968828-4.patch, failed testing.

podarok’s picture

Status: Needs work » Postponed
Related issues: +#2167033: Fixing tests in 2014

tests are broken
postponing this before tests fixed

vijaycs85’s picture

Status: Postponed » Needs review
vijaycs85’s picture

podarok’s picture

Status: Needs review » Reviewed & tested by the community
vijaycs85’s picture

Thanks, Committed 862434a and pushed to 7.x-2.x. Just needs update on issue summary about the user_access change...

vijaycs85’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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