[wp-trac] [WordPress Trac] #10972: Changeset 11282 performance regression - and no need to sanitize_post more than once

WordPress Trac wp-trac at lists.automattic.com
Sun Oct 18 13:28:22 UTC 2009


#10972: Changeset 11282 performance regression - and no need to sanitize_post more
than once
-------------------------+--------------------------------------------------
 Reporter:  johanee      |       Owner:            
     Type:  enhancement  |      Status:  new       
 Priority:  normal       |   Milestone:  Unassigned
Component:  Performance  |     Version:  2.9       
 Severity:  normal       |    Keywords:  has-patch 
-------------------------+--------------------------------------------------
 http://core.trac.wordpress.org/changeset/11282 resulted in a 5%
 performance regression.

 sanitize_post() is called on every get_post(), which is used almost
 everywhere such as in commonly-called template functions (the_title,
 get_permalink, etc.).

 A better solution than reverting the commit is to call sanitize_post()
 once only for a post: before storing in wp_cache_add() and for
 wp_query->posts. Instead of for example 16 times for each post in default
 theme.

 This patch restores the performance lost by changeset 11282.

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


More information about the wp-trac mailing list