[wp-trac] [WordPress Trac] #15458: Lazy-load usermeta into the user object

WordPress Trac wp-trac at lists.automattic.com
Sat Oct 8 01:22:52 UTC 2011


#15458: Lazy-load usermeta into the user object
----------------------------------------+-----------------------
 Reporter:  nacin                       |       Owner:
     Type:  enhancement                 |      Status:  reopened
 Priority:  normal                      |   Milestone:  3.3
Component:  Performance                 |     Version:
 Severity:  normal                      |  Resolution:
 Keywords:  has-patch needs-unit-tests  |
----------------------------------------+-----------------------

Comment (by nacin):

 We can also add in a `defined('MULTISITE')` check before (or after) `$key
 === $wpdb->base_prefix . 'capabilities', to make sure we're operating on
 the main blog of a 3.0+ multisite.

 I'm open to suggestions on how to better order the various conditions in
 the loop to ensure that common and fast cases are treated higher up.

 Ryan relays that blogs_of_user caching reduced load on WP.com when it was
 introduced, but it may have been just patching the symptoms. Fixing up the
 blog details caching in 3.1 and user objects in 3.2 might mean we can yank
 the caching here.

 User objects (before this ticket) could get pretty large. Like 300k large.
 As long as the user's meta is in cache, though, we'll be loading it but
 only processing the keys. I doubt looping through even a few hundred meta
 keys would cause enough load to require caching. I dunno. Worth some
 serious testing.

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


More information about the wp-trac mailing list