[wp-trac] [WordPress Trac] #50223: Performance improvement: Avoid using array_unique() where possible

WordPress Trac noreply at wordpress.org
Fri May 22 10:39:29 UTC 2020


#50223: Performance improvement: Avoid using array_unique() where possible
-------------------------------+------------------------------
 Reporter:  aristath           |       Owner:  (none)
     Type:  enhancement        |      Status:  new
 Priority:  lowest             |   Milestone:  Awaiting Review
Component:  General            |     Version:
 Severity:  normal             |  Resolution:
 Keywords:  reporter-feedback  |     Focuses:  performance
-------------------------------+------------------------------

Comment (by Cybr):

 I believe the most prominent ones are at:

 `.\wp-admin\load-scripts.php`
 `.\wp-admin\load-styles.php`
 `.\wp-includes\çlass-wp-query.php`

 Via Xdebug, you can find how many times this function is called during a
 typical request so that you can estimate the relative performance impact
 based on the results from the OP.

 However, I don't think we should sacrifice readability for this. A flip-
 flip doesn't convey that the variable is transformed to yield unique keys;
 I, therefore, believe these rudimentary issues should be forwarded to the
 PHP Group.

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


More information about the wp-trac mailing list