General Optimization
Hi everyone!
I have some questions about genral code optimization, i'll demonstreate using examples below:
1) is it better to use: for(i = 0 ; i < Array.length ; i++)
{
code...
}
or:
length = Array.length
for(i = 0 ; i < length ; i++)
{
code...
}
2) is it better to use : for (i = 0 ; i < NUM ; i++)
{
if (tempArray.property == something)
{
code...
}
}
or: for (i = 0 ; i <NUM ; i++)
{
tempVar = tempArray
if (tempVar.property == something)
{
code...
}
}
3)(maybe somilar to 2..) is it better to use: for (i = 0 ; i < NUM : i ++)
{
array = new object(....)
}
or: for (i = 0 ; i < NUM : i ++)
{
tempObject = new object(....)
array = tempObject
}
I have more questions like that, but answering those should get me started...
Also, is there aby fomral Adobe documentation regarding these things? I couldn'y find any...So if someone could refer me to such (if exists), I'd be thankful.
(Edit: by preformance I mean RAM usage and calculaton time - I'm developing for mobile so these are crucial)
Thank you!
