[wp-trac] [WordPress Trac] #6464: convert_smilies is very slow

WordPress Trac wp-trac at lists.automattic.com
Sun Mar 30 10:20:10 GMT 2008


#6464: convert_smilies is very slow
--------------------------+-------------------------------------------------
 Reporter:  Acci          |       Owner:  anonymous
     Type:  defect        |      Status:  new      
 Priority:  normal        |   Milestone:  2.7      
Component:  Optimization  |     Version:           
 Severity:  normal        |    Keywords:           
--------------------------+-------------------------------------------------
 I created a testing WordPress blog with 10 posts and I found huge
 performance problem in `convert_smilies` function. This function took at
 average 39 ms on my high-end PC.

 Currently this function uses `preg_replace` and it's called 40× for each
 part of the post.

 My solution is to use very similar function `preg_replace_callback` with
 modified regular expression. This solution is 6× faster than original (5,9
 ms).

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


More information about the wp-trac mailing list