Avoid repetitive calls to user_load() in og_is_group_member

Created on 20 December 2010, almost 14 years ago
Updated 27 October 2024, 25 days ago

A patch to add caching of user objects in og_is_group_member(). When logged in as user 1 to our site, OG was making about 22 calls to user_load() for user 1 when the front page is loaded. After this patch, it now only makes one. (Each call to user_load() causes two SQL queries, so this also caused 42 less queries.)

In D7, user_load() will finally do its own caching (sort of).

πŸ“Œ Task
Status

Closed: outdated

Version

2.0

Component

og.module

Created by

πŸ‡ΊπŸ‡ΈUnited States Garrett Albright

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.

  • πŸ‡·πŸ‡΄Romania claudiu.cristea Arad πŸ‡·πŸ‡΄

    This version of Drupal is not supported anymore. If this is still an issue in the 8.x-1.x branch, please open a new up-to-date ticket. Closing.

Production build 0.71.5 2024