Opened 16 years ago
Closed 16 years ago
#5458 closed defect (bug) (fixed)
making get_pages and wp_list_pages faster
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 2.5 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Optimization | Keywords: | has-patch needs-testing |
Focuses: | Cc: |
Description
When there are a lot of pages, these functions slow down quite a bit.
Should improve on the algorithm so that they speed up. (using logic similar to 5303).
Attachments (2)
Change History (13)
#3
@
16 years ago
Working well in my tests. Now we can set hierarchical to false when calling get_pages() and get_terms() to avoid the hierarchy sorting done in those functions. Actually, get_terms() will require some finesse because it does some things to counts for term hierarchies.
#5
@
16 years ago
Small patch that calls get_pages() with heirarchical set to 0 since the new walker code doesn't need get_pages() to pre-sort the results. Need to profile this with lots of pages.
Note: See
TracTickets for help on using
tickets.
Per Ryan's request, I've rewrote the Walk class which is a core class used in wp_list_pages, etc to generate nested pages.
The resulting implemenation is much faster, with O(N) time complexity.
and the code is more simple, thus easier to understand and maintain.
Tested on my local wporg and wpcom sandbox.