I'm testin some computation to improve my particle 3D manager speed.
While testing one my trig, comparing using a 3 numbers or a number3D,
i found something bizarre, that is still there when reduce to this
simple test :
import away3d.core.math.*;
////
var time:Number = getTimer();
var dx:int = 0;
var i:int;
var j:int;
var jp:Number3D = new Number3D(0,0,0);
function runClassicTest():void
{
time = getTimer();
for(i=0;i<10000;i++)
{
for (h=0;h<100;h++){
dx += 1.7*i;
}
}
trace("classicTest: ", (getTimer()-time));
trace(dx);
}
function runNativeTest():void
{
time = getTimer();
for(i = 0;i<10000;i++)
{
for (h=0;h<100;h++){
jp.x += 1.7*i;
}
}
trace("nativeTest: ", (getTimer()-time));
trace(jp.x);
}
runClassicTest(); >> return -90930768
runNativeTest(); >> return 8499150000.000024
When dealing with simple or more complex operations ( excepted += 1 )
I always have a difference when using a Number3D property (whenever
it's an integer or float).
I thought they should be the same ????
Should I visit a doctor, or have a sleep ???
for the rest of the test, I'll post some interesting result when sure
about it.
I'm not sure of nothing anymore... I have to make a DNA test for my
son...