Opened 10 years ago
Closed 10 years ago
#30928 closed enhancement (fixed)
Small performance improvement of wp_count_posts
Reported by: | minderdl | Owned by: | SergeyBiryukov |
---|---|---|---|
Milestone: | 4.2 | Priority: | normal |
Severity: | normal | Version: | 2.5.1 |
Component: | Posts, Post Types | Keywords: | has-patch commit |
Focuses: | Cc: |
Description
In wp_count_posts() the query is built all the time, even if the results from the cache are used (for which only the cache key is needed). Is there a reason for this?
IMO a small performance improvement can be made by moving the lines building $query inside the "if ( false === $counts )" branch.
Attachments (2)
Change History (4)
Note: See
TracTickets for help on using
tickets.
Introduced in [7638].