Posts Tagged if-else tree

If-Else Trees vs. Objects and Dictionaries

Tags: , , ,

If-else trees have some of the best performance of any conditional code, including if-else ladders, the ternary (? :) operator, and the switch statement. But how do they stack up against the O(1) lookups that Object and Dictionary offer us AS3 programmers? Today’s article finds out!

Read the rest of this article »

11 Comments

ASC 2.0 Conditionals Performance

Tags: , , , , , , , ,

Surprisingly, some interesting things have been happening with conditionals like if-else in AS3. First, a brand new AS3 compiler—ASC 2.0—has been released with the promise that it’ll generate more efficient bytecode. Second, some readers have pointed out the existence of a new (to me) technique: the “if-else tree”. Today’s article takes a look at just what that is and tests it against the classic options: if-else, the ternary (? :) operator, and the switch statement. Which will be fastest?

Read the rest of this article »

19 Comments