02-20-2006 09:21 AM
02-20-2006 10:16 AM - edited 02-20-2006 10:16 AM
Message Edited by smercurio_fc on 02-20-2006 10:17 AM
03-16-2010 10:02 AM
I had exactly the same issue as Spartan00.
Just for curiosity, I was comparing labview speed in initializing a gaussian array through both the normal graphic code and the formula node.
The formula node proved to be MUCH, MUCH faster.
float m = 0.5, s=0.5, x; int i; float y[1000000]; for(i=0; i<1000000; i++) { x=i*1e-6; y[i]=exp(-pow((x-m),2)/(2*s)); }
Unfortunately, I can't wire the array size as an input.
(By the way, I simply enclosed the formula node in a for loop and let it run 10000 times to get the average execution time. I did the same for the equivalent graphical code and it turned out to be much slower).
Has anybody ever tried to do the same?
03-16-2010 10:13 AM
I think your formula node was constant folded. Try passing at least one parameter from LV, e.g. m or s.
03-16-2010 10:24 AM
Excellent point dan_u, you are right, thanks.
Now it is sensibly slowed down. Still a bit faster than the G code but the difference is really small now.