Opened 6 years ago

Closed 5 years ago

Last modified 5 years ago

#5335 closed enhancement (invalid)

Performance tweak for apply_filters loop

Reported by: Quandary Owned by: anonymous
Priority: normal Milestone:
Component: Optimization Version: 2.3.1
Severity: normal Keywords: dev-feedback
Cc:

Description

This patch uses foreach to reduce the time it takes to execute apply_filters (on my box) from an average of 120,694 ticks/standard deviation 33,038 ticks, to an average of 99,149 ticks/standard deviation 20,636 ticks. The sample size was 20 runs each, before and after.

Attachments (2)

use_foreach_in_apply_filters.diff (669 bytes) - added by Quandary 6 years ago.
Optimize apply_filters
use_foreach_with_wp_filter.diff (2.2 KB) - added by Quandary 6 years ago.
Use foreach everywhere $wp_filter is iterated over

Download all attachments as: .zip

Change History (12)

Optimize apply_filters

Use foreach everywhere $wp_filter is iterated over

Stats on the second patch:

originalpatched
total runtime (mean)1,972,8541,943,093
total runtime (std dev)116,697110,741
add_filter (mean)14,42414,592
add_filter (std dev)5,4583,224
apply_filters (mean)120,694103,971
apply_filters (std dev)33,03825,880

Sample size is still 20.

  • Milestone changed from 2.2.3 to 2.4
  • Type changed from defect to enhancement

For the record, this patch is written and tested against 2.3.1, not 2.4/trunk.

  • Version changed from 2.3 to 2.3.1
  • Keywords dev-feedback added

Is this still applicable for 2.3.x branch? Since none of these enhancements will apply to trunk, this isn't an issue for trunk and if it isn't going to go into 2.3.x, then it should be closed.

Right?

  • Keywords has-patch removed
  • Milestone changed from 2.4 to 2.5

Well, it would be unlikely to include this type of change in a maintenance release. Although the patches don't apply to trunk, do the concepts or are the issues already resolved on trunk using other code?

  • Resolution set to invalid
  • Status changed from new to closed

No. This was the ticket for 2.3.x and I made a ticket for trunk that was recently closed. If this isn't going to be applied to 2.3.x, then it just should be closed.

  • Milestone 2.5 deleted

darkdragon, it would have been awesome if you included that other ticket # ;-)

Okay, #5338.

Note: See TracTickets for help on using tickets.