[buddypress-trac] [BuddyPress Trac] #6221: messages-loop.php executes BP_Messages_Thread::populate() twice per conversation

buddypress-trac noreply at wordpress.org
Wed Apr 15 22:44:56 UTC 2015


#6221: messages-loop.php executes BP_Messages_Thread::populate() twice per
conversation
-----------------------------------+---------------------
 Reporter:  wpdennis               |       Owner:  r-a-y
     Type:  enhancement            |      Status:  closed
 Priority:  normal                 |   Milestone:  2.3
Component:  Component - Messaging  |     Version:
 Severity:  normal                 |  Resolution:  fixed
 Keywords:  has-patch commit       |
-----------------------------------+---------------------
Changes (by r-a-y):

 * owner:   => r-a-y
 * status:  new => closed
 * resolution:   => fixed


Comment:

 In [changeset:"9753"]:
 {{{
 #!CommitTicketReference repository="" revision="9753"
 Messages: Cache calls to `BP_Messages_Thread` class.

 This commit:

 - Introduces static method - `BP_Messages_Thread::get_messages()` - caches
 fetching messages by thread ID and introduces the `'bp_messages_threads'`
 cache group.
 - Converts `BP_Messages_Thread::check_access()` and
 `BP_Messages_Thread::is_valid()` methods from using direct DB queries to
 reference the cache.
 - Includes unit tests.
 - Consolidates cache clearing functions in bp-messages-cache.php.

 This handles the majority of uncached message DB queries. For the inbox
 page, if there are 10 message threads in the loop, we save 20 DB queries.
 On a single message thread, we save 5 DB queries.

 Fixes #6221.
 }}}

--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/6221#comment:14>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac


More information about the buddypress-trac mailing list