Problem/Motivation

When field views data is being built, it individually loads fields per bundle to check if they're translatable, using direct config entity loads, then later on, loads all the bundle fields anyway via the entity field manager.

If we use the entity field manager consistently, it saves separate database queries, cache sets and gets on cold caches.

Steps to reproduce

NA

Proposed resolution

In FieldViewsDataProvider break out nested foreach loop.

Remaining tasks

User interface changes

NA

Introduced terminology

NA

API changes

NA

Data model changes

NA

Release notes snippet

Issue fork drupal-3564973

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

catch created an issue. See original summary.

catch’s picture

Status: Active » Needs review
smustgrave’s picture

Issue summary: View changes
Status: Needs review » Reviewed & tested by the community
Issue tags: +Needs Review Queue Initiative

Okay tried my best with the visual review since not sure how to manually test it. Full disclosure leaning on the performance tests for this one.

That said looking at the changes in FieldViewsDataProvider and it makes sense to breakout the foreach loop.

Going to take a swing.

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.

needs-review-queue-bot’s picture

Status: Reviewed & tested by the community » Needs work
StatusFileSize
new91 bytes

The Needs Review Queue Bot tested this issue. It no longer applies to Drupal core. Therefore, this issue status is now "Needs work".

This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.

Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.

catch’s picture

Status: Needs work » Reviewed & tested by the community

Rebased.

alexpott’s picture

Version: main » 11.x-dev
Status: Reviewed & tested by the community » Fixed

Committed af66597 and pushed to 11.x. Thanks!
Committed de026a4 and pushed to main. Thanks!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

  • alexpott committed af665970 on 11.x
    perf: #3564973 Optimize field views data building
    
    By: catch
    (cherry...

  • alexpott committed de026a46 on main
    perf: #3564973 Optimize field views data building
    
    By: catch
    

Status: Fixed » Closed (fixed)

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