[wp-trac] [WordPress Trac] #5303: "Manage > Pages" becomes very slow with hundreds of pages

WordPress Trac wp-trac at lists.automattic.com
Thu Nov 1 07:22:36 GMT 2007


#5303: "Manage > Pages"  becomes very slow with hundreds of pages
-----------------------+----------------------------------------------------
 Reporter:  MartijnD   |       Owner:  anonymous
     Type:  task       |      Status:  new      
 Priority:  low        |   Milestone:  2.5      
Component:  General    |     Version:           
 Severity:  normal     |    Keywords:           
-----------------------+----------------------------------------------------
 Apologies if this has been mentioned before, I couldn't find a relevant
 related bug.

 I am currently building a prototype blog / content site that has several
 hundreds of "Pages"; and things have slown down a lot. With just over 250
 pages, generation of "Manage > Pages" takes over 30 seconds, which causes
 PHP time out errors on the server.

 Some profiling shows that most time is spend in:

 \wp-admin\includes\template.php
 166: function page_rows()

 The code for hierarchal display is very inefficient, as it loops over and
 over the full set of posts to check if a post and a parent are related.

 180:    if ( $hierarchy && ($post->post_parent != $parent) )
 181:                    continue;

 Forcing $hierachy to false reduces the page creation time to 7-8 seconds.
 Still not great, it should be possible to do this in < 2 seconds.

 Please take this as suggestion for improvement.

 If I have time, I will look into finding a more efficient piece of code --
 for now I still have a couple more pages to add ;-)

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


More information about the wp-trac mailing list