[wp-trac] [WordPress Trac] #21120: Optimize get_user_by()

WordPress Trac wp-trac at lists.automattic.com
Fri Jul 6 21:06:32 UTC 2012


#21120: Optimize get_user_by()
------------------------------------+------------------------------
 Reporter:  kurtpayne               |       Owner:
     Type:  enhancement             |      Status:  new
 Priority:  normal                  |   Milestone:  Awaiting Review
Component:  Performance             |     Version:
 Severity:  normal                  |  Resolution:
 Keywords:  dev-feedback has-patch  |
------------------------------------+------------------------------

Comment (by kurtpayne):

 This is the important behavior from `_prime_user_cache` that isn't
 replicated by `WP_User_Query`

 {{{
 $user->init( $userdata );
 }}}

 Right now the only place where `WP_User::init` is called is from
 `get_user_by`, so the added caching here is important.  The author caching
 in the post query may be moot as a list of 20 posts that reference 4
 authors will result in 4 cache misses either way.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/21120#comment:10>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list