[wp-trac] [WordPress Trac] #26640: [Patch] Performance Increase in apply_filter() (~11%)

WordPress Trac noreply at wordpress.org
Mon Dec 16 11:14:11 UTC 2013


#26640: [Patch] Performance Increase in apply_filter() (~11%)
-------------------------+------------------------------
 Reporter:  dshafik      |       Owner:
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  Awaiting Review
Component:  General      |     Version:  trunk
 Severity:  normal       |  Resolution:
 Keywords:               |
-------------------------+------------------------------
Changes (by nacin):

 * version:  1.5 => trunk
 * component:  Plugins => General


Comment:

 Avoiding current() seems like a nice idea here. I thought for a moment you
 were going to suggest a switch to foreach, which has its own
 complications. I think #17817 is the big ticket talking about that.

 Switching away from call_user_func_array() has some drawbacks, though.
 Right now, if a filter's callback does not exist, an E_WARNING is issued.
 That's just about the right amount of yelling at a developer. See also
 #15296. $foo(), though, causes a fatal error, which will definitely break
 sites. I imagine tossing a function_exists() or is_callable() in here
 would outweigh the switch from call_user_func_array().

--
Ticket URL: <http://core.trac.wordpress.org/ticket/26640#comment:2>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list