Function Calls

Function calls are very expensive in terms of speed. Therefore it makes a lot of sense to inline very simple methods. There is of course a tradeoff since ActionScript does not support inlining of methods. Refactoring or bugfixing inlined code can be a pain since it has been distributed over the whole project.

Example
Math.abs is a good example for an expensive function call and the tradeoff for inlining a method. Math.abs is so simple that it makes a lot of sense to inline it directly.

Slow Version
y = Math.abs(x);

Fast Version
y = x > 0.0 ? x : -x;

Note: There is an even faster version for integer values using Bitwise Operations.