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

WordPress Trac wp-trac at lists.automattic.com
Fri Jul 6 23:10:29 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):

 Replying to [comment:13 scribu]:
 > Besides, WP_User::init() doesn't seem that expensive.

 It compounds when it's called 260+ times when it's only needed 4 times.

 On my local dev server, this saves ~30ms of wall time (~5%).  The xdebug
 profiling times ([[attachment:get_user_by_grind.png]]) are a little
 inflated because of the overhead, but this optimization does have a net
 positive impact.

 I vote for leaving it at [[attachment:21120.2.patch]] and dropping the
 post_author caching.

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


More information about the wp-trac mailing list