[wp-trac] [WordPress Trac] #18968: Remove some term cache misses

WordPress Trac wp-trac at lists.automattic.com
Mon Oct 17 01:44:42 UTC 2011


#18968: Remove some term cache misses
-------------------------+-----------------------------
 Reporter:  johnbillion  |      Owner:
     Type:  enhancement  |     Status:  new
 Priority:  normal       |  Milestone:  Awaiting Review
Component:  Performance  |    Version:  3.3
 Severity:  normal       |   Keywords:
-------------------------+-----------------------------
 On post listing screens a database query is performed for each taxonomy on
 each post. We can hit the term cache instead by using `get_the_terms()` in
 place of `wp_get_object_terms()` and `wp_get_post_terms()`.

 By default, this change won't impact performance because the term cache
 isn't primed at this point, but on a site using a persistent object cache
 it'll hit the term cache each time instead of performing a database query.
 This saves `{numberofposts} × {numberoftaxonomies}` queries which can be
 quite a few on custom post type screens which display several taxonomy
 columns.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/18968>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list