[wp-trac] [WordPress Trac] #57373: WP_Query loading posts twice.

WordPress Trac noreply at wordpress.org
Wed Jan 4 23:11:45 UTC 2023


#57373: WP_Query loading posts twice.
--------------------------+--------------------------
 Reporter:  spacedmonkey  |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  6.1.2
Component:  Query         |     Version:  6.1
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |     Focuses:  performance
--------------------------+--------------------------

Comment (by spacedmonkey):

 After spending some time doing profiling, here is the results.

 Option 1.

 Most complex solution but results in the best results.

 PR [https://github.com/WordPress/wordpress-develop/pull/3793 #3793]

 [[Image(https://core.trac.wordpress.org/raw-
 attachment/ticket/57373/Screenshot%202023-01-04%20at%2023.00.09.png)]]

 Option 2.

 Clever solution, but it results in updating caches if not needed but then
 going another get of all the posts. This is wasteful.

 PR [https://github.com/WordPress/wordpress-develop/pull/3811 #3811]

 [[Image(https://core.trac.wordpress.org/raw-
 attachment/ticket/57373/Screenshot%202023-01-04%20at%2023.00.35.png)]]

 Option 3.

 Simplest solution, as it is a revert of the logic. However, it does mean
 more writes to caches that are unneeded. This results in a performance
 lose.

 PR [https://github.com/WordPress/wordpress-develop/pull/3815 #3815]

 [[Image(https://core.trac.wordpress.org/raw-
 attachment/ticket/57373/Screenshot%202023-01-04%20at%2022.51.04.png)]]

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/57373#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list