[wp-trac] [WordPress Trac] #17817: do_action/apply_filters/etc. recursion on same filter kills underlying call

WordPress Trac noreply at wordpress.org
Fri Oct 17 19:49:04 UTC 2014


#17817: do_action/apply_filters/etc. recursion on same filter kills underlying call
-------------------------------------------------+-------------------------
 Reporter:  kernfel                              |       Owner:
     Type:  defect (bug)                         |      Status:  reopened
 Priority:  normal                               |   Milestone:  Future
Component:  Plugins                              |  Release
 Severity:  normal                               |     Version:  2.2
 Keywords:  dev-feedback has-unit-tests has-     |  Resolution:
  patch                                          |     Focuses:
-------------------------------------------------+-------------------------

Comment (by jbrinley):

 @johnbillion requested some memory statistics in IRC. Had to break the
 tests out into multiple files so we could isolate processes and report
 peak memory independently. https://gist.github.com/jbrinley/7518483 is
 updated to reflect the change. Looks like the new code uses about 3% more
 memory for the hook system (i.e., about 50-100 KB more memory).

 {{{
 $ php tests.local/test_17817.php
 Running 10000 times with 0 callbacks
 Total Time (Old): 0.078679
 Average Time (Old): 0.000008
 Peak Memory after Old: 1755592

 Total Time (New): 0.057374
 Average Time (New): 0.000006
 Peak Memory after New: 1800080

 New runs in 72.92% of the time of old.
 New runs in 102.53% of the memory of old.

 $ php tests.local/test_17817.php
 Running 10000 times with 1 callbacks
 Total Time (Old): 0.264266
 Average Time (Old): 0.000026
 Peak Memory after Old: 1758256

 Total Time (New): 0.260950
 Average Time (New): 0.000026
 Peak Memory after New: 1804336

 New runs in 98.75% of the time of old.
 New runs in 102.62% of the memory of old.

 $ php tests.local/test_17817.php
 Running 10000 times with 2 callbacks
 Total Time (Old): 0.339878
 Average Time (Old): 0.000034
 Peak Memory after Old: 1759384

 Total Time (New): 0.340070
 Average Time (New): 0.000034
 Peak Memory after New: 1805408

 New runs in 100.06% of the time of old.
 New runs in 102.62% of the memory of old.

 $ php tests.local/test_17817.php
 Running 10000 times with 3 callbacks
 Total Time (Old): 0.434463
 Average Time (Old): 0.000043
 Peak Memory after Old: 1760080

 Total Time (New): 0.422050
 Average Time (New): 0.000042
 Peak Memory after New: 1806296

 New runs in 97.14% of the time of old.
 New runs in 102.63% of the memory of old.

 $ php tests.local/test_17817.php
 Running 10000 times with 5 callbacks
 Total Time (Old): 0.630719
 Average Time (Old): 0.000063
 Peak Memory after Old: 1761904

 Total Time (New): 0.557231
 Average Time (New): 0.000056
 Peak Memory after New: 1808352

 New runs in 88.35% of the time of old.
 New runs in 102.64% of the memory of old.

 $ php tests.local/test_17817.php
 Running 10000 times with 10 callbacks
 Total Time (Old): 1.133310
 Average Time (Old): 0.000113
 Peak Memory after Old: 1766352

 Total Time (New): 0.917521
 Average Time (New): 0.000092
 Peak Memory after New: 1813496

 New runs in 80.96% of the time of old.
 New runs in 102.67% of the memory of old.

 $ php tests.local/test_17817.php
 Running 1000 times with 100 callbacks
 Total Time (Old): 0.913040
 Average Time (Old): 0.000913
 Peak Memory after Old: 497704

 Total Time (New): 0.748710
 Average Time (New): 0.000749
 Peak Memory after New: 574104

 New runs in 82.00% of the time of old.
 New runs in 115.35% of the memory of old.

 $ php tests.local/test_17817.php
 Running 1000 times with 1000 callbacks
 Total Time (Old): 6.859408
 Average Time (Old): 0.006859
 Peak Memory after Old: 1273632

 Total Time (New): 5.400719
 Average Time (New): 0.005401
 Peak Memory after New: 1400144

 New runs in 78.73% of the time of old.
 New runs in 109.93% of the memory of old.
 }}}

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


More information about the wp-trac mailing list