[buddypress-trac] [BuddyPress Trac] #5979: `bp_core_userdata_` cache is unnecessary

buddypress-trac noreply at wordpress.org
Sun Nov 2 23:53:09 UTC 2014


#5979: `bp_core_userdata_` cache is unnecessary
-----------------------------+------------------
 Reporter:  johnjamesjacoby  |       Owner:
     Type:  defect (bug)     |      Status:  new
 Priority:  high             |   Milestone:  2.2
Component:  Members          |     Version:
 Severity:  normal           |  Resolution:
 Keywords:  has-patch        |
-----------------------------+------------------

Comment (by boonebgorges):

 >  Just ran into that. You beat me to the updated patch. I see no reason
 why BP_User_Query shouldn't assume all_with_meta considering our current
 usages.

 `all_with_meta` is pretty heavy-duty - it primes the usermeta cache for
 each matched user. On the typical BP setup, I don't think we use much
 usermeta in the loop that we're not fetching elsewhere, and in my
 experience, a lot of plugins can leave a lot of junk in usermeta. So I'm
 wary of defaulting to it. As long as the core wp_users data is being
 cached (which it is in `WP_User`) I lean toward not using `all_with_meta`,
 and maybe allowing it as an option in `BP_User_Query`.

 Regarding tests, just to give you a head start: look at
 `$wpdb->num_queries` before and after running :)

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


More information about the buddypress-trac mailing list