[wp-trac] [WordPress Trac] #2463: get_permalink() performance improvement

WordPress Trac wp-trac at lists.automattic.com
Thu Feb 16 19:07:04 GMT 2006


#2463: get_permalink() performance improvement
--------------------------+-------------------------------------------------
       Id:  2463          |      Status:  new                     
Component:  Optimization  |    Modified:  Thu Feb 16 19:07:04 2006
 Severity:  normal        |   Milestone:                          
 Priority:  normal        |     Version:  1.2                     
    Owner:  anonymous     |    Reporter:  arnee                   
--------------------------+-------------------------------------------------
 template-functions-links.php

 Change the get_permalink() function from:
 {{{
                 $rewritereplace =
                 array(
                         date('Y', $unixtime),
                         date('m', $unixtime),
                         date('d', $unixtime),
                         date('H', $unixtime),
                         date('i', $unixtime),
                         date('s', $unixtime),
                         $post->post_name,
                         $post->ID,
                         $category,
                         $author,
                         $post->post_name,
                 );
 }}}

 to:
 {{{
                 $date = explode(" ",date('Y m d H i s', $unixtime));
                 $rewritereplace =
                 array(
                         $date[0],
                         $date[1],
                         $date[2],
                         $date[3],
                         $date[4],
                         $date[5],
                         $post->post_name,
                         $post->ID,
                         $category,
                         $author,
                         $post->post_name,
                 );
 }}}

 This will speed up the function by 50 percent. This is a enormous value if
 you have to generate permalinks for all of your posts. I hope this will be
 added to the next release.

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


More information about the wp-trac mailing list