[wp-trac] [WordPress Trac] #12611: Performance hit from update_post_caches

WordPress Trac wp-trac at lists.automattic.com
Fri Apr 23 20:01:49 UTC 2010


#12611: Performance hit from update_post_caches
--------------------------+-------------------------------------------------
 Reporter:  prettyboymp   |       Owner:  ryan                  
     Type:  defect (bug)  |      Status:  assigned              
 Priority:  normal        |   Milestone:  3.0                   
Component:  Performance   |     Version:                        
 Severity:  normal        |    Keywords:  dev-feedback has-patch
--------------------------+-------------------------------------------------
Changes (by scribu):

  * keywords:  dev-feedback => dev-feedback has-patch


Comment:

 > If you use query_posts and filter the returned columns using the
 'posts_fields' filter, the resulting post objects will be cached, and
 could disrupt normal behavior in your theme.

 I've run into this problem too. Patch adds a 'cache_results' option to
 WP_Query.

 I also noticed that update_post_caches() uses an unefficient for loop,
 when a faster foreach could be used.

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


More information about the wp-trac mailing list