[buddypress-trac] [BuddyPress Trac] #7436: Very slow check_is_friend function

buddypress-trac noreply at wordpress.org
Tue Feb 27 13:29:33 UTC 2018

#7436: Very slow check_is_friend function
 Reporter:  januzi_pl     |       Owner:  dcavins
     Type:  defect (bug)  |      Status:  closed
 Priority:  high          |   Milestone:  3.0
Component:  Friends       |     Version:  2.7
 Severity:  major         |  Resolution:  fixed
 Keywords:  dev-feedback  |
Changes (by dcavins):

 * owner:   => dcavins
 * status:  new => closed
 * resolution:   => fixed


 In [changeset:"11865"]:
 #!CommitTicketReference repository="" revision="11865"
 Change check in BP_Friends_Friendship::check_is_friend().

 In BP2.5, we introduced a new friendship caching mechanism that created a
 new cache item containing all of a user's friendships. This approach
 worked well on sites with fewer friendships per user, but caused cache
 access issues on sites with lots of friendship connections.

 This update replaces the cache-intensive change to
 `BP_Friends_Friendship::check_is_friend()` with a return to a single
 lookup to determine friendship status between two users. To minimize SQL
 lookups, individual friendships are now cached, and a new cache-warming
 function has been added to bulk update these new cache items:

 Props januzi_pl, boonebgorges, r-a-y, djpaul, dcavins.

 Fixes #7436.

Ticket URL: <https://buddypress.trac.wordpress.org/ticket/7436#comment:25>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac

More information about the buddypress-trac mailing list