[wp-trac] [WordPress Trac] #56541: Performance: Don't execute jumps in loops
WordPress Trac
noreply at wordpress.org
Tue Jun 27 14:33:55 UTC 2023
#56541: Performance: Don't execute jumps in loops
-------------------------+---------------------------
Reporter: Cybr | Owner: spacedmonkey
Type: enhancement | Status: closed
Priority: normal | Milestone: 6.3
Component: General | Version:
Severity: normal | Resolution: fixed
Keywords: has-patch | Focuses: performance
-------------------------+---------------------------
Changes (by spacedmonkey):
* status: reviewing => closed
* resolution: => fixed
Comment:
In [changeset:"56066" 56066]:
{{{
#!CommitTicketReference repository="" revision="56066"
Database: Move the if statement outside of the loop.
In the foreach loop of last results, move the if statement outside of the
loop. There is no need to check every element in the array for the output
type. Do this once outside of the loop. For large database queries with
lots of rows returned, this should improve PHP performance.
Props spacedmonkey, Cybr, johnbillion, costdev, joemcgill.
Fixes #56541.
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/56541#comment:9>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list