Can we fast compute 1.0/x ? static public function recriprocal( value:Number ):Number { return 1.0/value; } So here some ideas, we already have a fast way to compute 1/sqrt(x), if you look at 1/x and 1/sqrt(x) , you will notice that both equations are pretty close, so it gives us a pretty good “first guess”. […]

~ read more ~## Posts tagged optimization

# More On Radix and FlashSort

Let’s see how well our FlashSort and RadixSort functions are performing under specific conditions: * when the keys in the array are uniques : ex:[9 7 8 1 3 2 5 6 4 7 8] * when the array is already sorted ex:[ 1 2 3 4 5 6 7 8 9] * when the […]

~ read more ~# AS3 loop speed

What is the fastest way to loop ? We have an integer i, and we want to increment i until it reach REPS, fastest way ? 1) for(i= 0;i<REPS;i++) 2) for(i=-1;++i<REPS;) 3) for(i= REPS;–i;) 4) for(i= 0;(i-REPS)>>31;i++) 5) for(i= -1;(++i-REPS)>>31;) 6) for(i= -1;(++i-REPS)>>>31;) All those methods are equivalents, except for 3 where we decrease i […]

~ read more ~
## Recent Comments