Improve performance of getReferencableEntities()

Created on 6 December 2013, about 11 years ago
Updated 14 April 2023, over 1 year ago

Problem: On a site with 43,070 users where each user has an Entityreference field that references other users (their "trusted contacts"), the user/[uid]/edit page times out.

Some troubleshooting brought me to this part of the code flow:
- entityreference_options_list() calls getReferencableEntities(), which in turn does an entity_load() on all referencable entities, in this case, every user on the site. Preventing this entity_load() for specifically the trusted contacts field alleviates the page timeout.

It appears that we should find another method for collecting information about the referancable entities, such as a database query.

✨ Feature request
Status

Fixed

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States ezra-g

Live updates comments and jobs are added and updated live.
  • Performance

    It affects performance. It is often combined with the Needs profiling tag.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024