[wp-trac] [WordPress Trac] #10987: Improve wptexturize performance

WordPress Trac wp-trac at lists.automattic.com
Tue Oct 20 17:35:49 UTC 2009

#10987: Improve wptexturize performance
 Reporter:  johanee      |       Owner:            
     Type:  enhancement  |      Status:  new       
 Priority:  normal       |   Milestone:  Unassigned
Component:  Performance  |     Version:  2.9       
 Severity:  major        |    Keywords:  has-patch 
 wptexturize is called for most text shown which makes it highly
 performance sensitive.

 With minimal changes the performance can be improved dramatically:[[BR]]
 1. Make various variables static so they only need to be setup once
 (instead of 60+ times, on a simple page)[[BR]]
 2. Make wptexturize_pushpop_element more efficient by using what we know
 about the string to check and improving the regexp strategy

 Performance for the suggested patch:
 Average total page load time (ab -c 1 -n 100 http://example.org/)
 Clean 2.9.0 revision 12065 install

 1 post front page
 org: 47ms
 fix: 44ms

 10 post front page
 org: 84ms
 fix: 76ms

 larger page from real world usage
 org: 135ms
 fix: 108ms

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

More information about the wp-trac mailing list