They are all placed in different high load conditions to notice performance.
Array syntax:
PHP Code:
//13.7 FPS
var arr=[]
PHP Code:
//15 FPS
var arr:Array = new Array()
Variable syntax:
PHP Code:
//9.8 FPS
var bool;
PHP Code:
//12.2 FPS
var bool:Boolean=false;
setInterval vs setTimeout
PHP Code:
//7 FPS
setInterval(costTest,10);
PHP Code:
//9.4 FPS
setTimeout(costTest,10); //recall inside costTest function
try catch vs if else
PHP Code:
//14.4 FPS
try{
}catch(e:*){
}
PHP Code:
//15 FPS
if(){
}else{
}
split building vs stringifying ints
PHP Code:
//2FPS
var str=int(str.split("_")[1])
PHP Code:
//3.6FPS
var str=("tile_"+ int("1") + int("2"))
onEnterFrame vs setTimeout
PHP Code:
//6.9FPS
stage.addEventListener(Event.ENTER_FRAME,loop);
function loop(e:Event){
}
PHP Code:
//15.6FPS
setTimeout(costTest,34)//recall inside costTest function
int wrapper vs no wrapper
PHP Code:
//4.5FPS
value=int(num)
PHP Code:
//5.5FPS
value=num
And now I will start programming with the higher frame rate methods since this test.