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

WordPress Trac wp-trac at lists.automattic.com
Fri Jul 13 15:49:45 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:18 scribu]:
 > map_meta_cap() receives a variable number of arguments:
 >
 > {{{
 >       $args = array_slice( func_get_args(), 2 );
 > }}}
 >
 > You can't just add a $cache parameter to it.

 Thanks, I missed the forest for the trees.

 The extra parameter could be taken care of with a filter.

 But since `$args` can be any object/scalar/array, the work it would take
 to generate a consistent key from this negate any cache savings.

 Seems like caching in `map_meta_cap` is out.

 @scribu, @nacin, Any ideas?

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


More information about the wp-trac mailing list