View Single Post
  #41   Spotlight this post!  
Unread 06-08-2010, 12:12
jhersh jhersh is offline
National Instruments
AKA: Joe Hershberger
FRC #2468 (Appreciate)
Team Role: Mentor
 
Join Date: May 2008
Rookie Year: 1997
Location: Austin, TX
Posts: 1,006
jhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond repute
Re: Is the crio powerful enough?

Quote:
Originally Posted by kamocat View Post
Yeah, I wasn't sure how to do that in a way that would prevent it from being preprocessed by the compiler. A million elements probably does count as a huge array.
My assumption was that by generating the array beforehand the FOR loop would simply replace each element in the array as it went through, eliminating the overhead of *creating* an array.
Since you are changing the value of the array, it's possible that LabVIEW's compiler would reuse that memory, but I wouldn't count on it. I'm not sure of all the optimizations that the 8.6 compiler employs or what constraints they have.

Perhaps you can run another test that computes y=sin(sin(x)) and subtract the timing results from the test you already ran. Then that will leave you with only the difference between calling sin twice compared to once for each call of the loop, and all of the loop structure and the array handling will be canceled out.

-Joe