[buddypress-trac] [BuddyPress Trac] #7661: Use WP functions to retrieve user name, display name, nicename, and email.

buddypress-trac noreply at wordpress.org
Mon Jan 22 22:39:40 UTC 2018


#7661: Use WP functions to retrieve user name, display name, nicename, and email.
-------------------------+----------------------------------
 Reporter:  dcavins      |       Owner:
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  Under Consideration
Component:  Members      |     Version:  2.9.2
 Severity:  normal       |  Resolution:
 Keywords:  has-patch    |
-------------------------+----------------------------------

Comment (by dcavins):

 Some notes about changing `bp_core_get_user_displaynames()`, a function
 that used a custom-to-BP bulk caching mechanism (and now relies on WP's
 user cache).

 I used this code (inserted in the body of WP page) as a check, with
 numbers reported by Query Monitor:

 {{{
 $users = array(
 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26 );
 var_dump( bp_core_get_user_displaynames( $users ) );
 }}}

 Before change:
 Page generation time 0.49S
 Peak memory usage: 25,636kB
 Database query time: 0.1794S
 Database queries: 41Q

 With change:
 Page generation time: 0.48S
 Peak memory usage: 25,765kB
 Database query time: 0.1896S
 Database queries: 42Q

 Comments welcome!

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


More information about the buddypress-trac mailing list