actionscript 3 - Which is faster: (i == 0) or (i < 1) -
i heard that:
//this: val1 * 0.5; //is faster this: val1 / 2;
so wonder if there else that, , ask:
var val1:uint = 0; //is this: if (val1 == 0) //faster this?: if (val1 < 1)
why? whichever do, compiler optimise on whatever platform compiling on.
if need check if it's 0, use (i == 0)
, if want know if it's less zero, use 1 instead. write read out loud.
tiny things won't make faster, , should worried readability , clean design rather tiny operation faster.
and if doesn't logical changes, chances on platform, both perform in 1 cpu cycle.
Comments
Post a Comment