execute0

6 views
Skip to first unread message

Tyler Wright

unread,
Jan 29, 2011, 3:59:37 PM1/29/11
to as3-s...@googlegroups.com
Has anyone done performance tests on execute0..2 vs. just using execute.apply?

From my tests the switch-statement actually slows it down enough that the single execute.apply is faster. I can double check though...

Tyler

ps I'm referring to some code internal to Signal for dispatching.

simon

unread,
Feb 1, 2011, 6:10:20 AM2/1/11
to as3-signals
You might want to try a if-statement in your tests as switch-statement
is considered slower then if-statement according to these tests
http://jacksondunstan.com/articles/1007

si

Robert Penner

unread,
Feb 1, 2011, 10:12:14 PM2/1/11
to as3-s...@googlegroups.com
Jackson's article on switch vs. if-else vs. ternary was an eye-opener.
I thought the bytecode was basically the same. Switches were generally
10-15% slower in his tests, but the impact in the context of a Signal
dispatch would need to be tested.

Robert

David,Linse

unread,
Feb 2, 2011, 11:15:32 AM2/2/11
to as3-s...@googlegroups.com

----- Ursprüngliche Nachricht -----
Von: simon <stick...@gmail.com>
Gesendet: Dienstag, 1. Februar 2011 12:10
An: as3-signals <as3-s...@googlegroups.com>
Betreff: [as3-signals] Re: execute0

Tyler Wright

unread,
Feb 2, 2011, 11:31:14 AM2/2/11
to as3-s...@googlegroups.com
I think my tests were with a single listener - switch vs always function.apply. It makes sense that if there were many listeners, using a switch/if-else/ternary initially wouldn't hurt the overall performance gain of choosing a more optimized execute statement.

But I still look at how much less code there would be, longingly, of skipping the executes altogether. Yes Stray, I said 'less code' ... I just can't help it, I'm flawed, obsessive.

Tyler
Reply all
Reply to author
Forward
0 new messages