Unnecessary duplication of execution in user_format_name_alter implementation

Created on 15 March 2023, about 2 years ago
Updated 20 March 2023, about 2 years ago

Problem/Motivation

We're seeing quite a few calls happening for social_user_user_format_name_alter(). In the example below on a user's stream page it happens ~100 times while there are only 3 unique users being displayed.

Steps to reproduce

Navigate to a user stream page with multiple posts or content items. Set a breakpoint in social_user_user_format_name_alter() and notice it goes through it multiple times and making requests for config and entity data without producing a different result.

Proposed resolution

Statically cache the outcome in social_user_user_format_name_alter() per account ID.

Remaining tasks

N/a

User interface changes

N/a

API changes

N/a

Data model changes

N/a

🐛 Bug report
Status

Fixed

Version

11.8

Component

Code (back-end)

Created by

🇳🇱Netherlands bramtenhove

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024