Opened 12 years ago
Closed 12 years ago
#30928 closed enhancement (fixed)
Small performance improvement of wp_count_posts
| Reported by: | minderdl | Owned by: | SergeyBiryukov |
|---|---|---|---|
| Priority: | normal | Milestone: | 4.2 |
| Component: | Posts, Post Types | Version: | 2.5.1 |
| Severity: | normal | Keywords: | has-patch commit |
| Cc: | Focuses: |
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.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Introduced in [7638].