[wp-trac] Re: [WordPress Trac] #7147: Problems with 700+ categories
WordPress Trac
wp-trac at lists.automattic.com
Tue Jun 17 01:24:37 GMT 2008
#7147: Problems with 700+ categories
--------------------------+-------------------------------------------------
Reporter: bi0xid | Owner: anonymous
Type: defect | Status: reopened
Priority: normal | Milestone: 2.6
Component: Optimization | Version: 2.5.1
Severity: normal | Resolution:
Keywords: |
--------------------------+-------------------------------------------------
Changes (by DD32):
* milestone: => 2.6
Comment:
> You have closed the ticket because #6561 exists. But it talks about
pages, not categories.
oops, Sorry, Mind hadnt fully woken up; I confused the Posts ticket with
the closed category ticket.
On my local system, I just setup 1000 categories, and assigned them all to
a post. It does indeed take about 10 seconds to show the entire tree.
There are a total of 2 queries made which used 60ms total.
Using the PHP Trace logs, i've come up with this:
{{{
wp_widget_categories: self: 3052ms; total: 6529ms
wp_list_categories: self: 0.5ms; total: 3477ms
get_categories: total: 2265ms
get_terms: total:1205ms
_get_term_children: 1179ms and calls itself a few thousand times
each taking 0.2~30ms which adds up to the 1179ms
walk_category_tree: total: 2256ms
Walker::walk 2265ms
Walker::display_element 0.1~60ms called
}}}
Looking at the functions called:
{{{
Walker:display_element
Average: 3.8ms
Total time: 3840ms
Calls: 1019
get_category_link
Average: 0.4ms
Total time: 471ms
Calls: 2009
Walker::start_el
Average: 0.4ms
Total time: 380ms
Calls: 1000
}}}
It seems that quite a lot of the time is simple Walker::display_element
taking 10+ms on some items.
--
Ticket URL: <http://trac.wordpress.org/ticket/7147#comment:4>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list