06-16-2010 01:07 AM
Hi Ben,
now you mentioned your source I remember this topic was explained in the Performance course.
But:
In the very same course we made some examples (using LV2009) regarding this matter. It turned out to be faster when I didn't trust the compiler to be clever enough. Fastest VI had all constant operations outside of loops...
Lessons learned from the course: Don't rely on the compiler
06-16-2010 07:08 AM
GerdW wrote:Hi Ben,
now you mentioned your source I remember this topic was explained in the Performance course.
But:
In the very same course we made some examples (using LV2009) regarding this matter. It turned out to be faster when I didn't trust the compiler to be clever enough. Fastest VI had all constant operations outside of loops...
Lessons learned from the course: Don't rely on the compiler
Thanks for confirming!
I would like to hear more about this myself since I could find no other references to this topic aside from what I posted.
This would be a good oppertunity for an NI Application Engineer to go find someone in R&D who can "lift the hood" a little more.
Ben
06-16-2010 08:43 AM
Ben wrote:
GerdW wrote:Hi Ben,
now you mentioned your source I remember this topic was explained in the Performance course.
But:
In the very same course we made some examples (using LV2009) regarding this matter. It turned out to be faster when I didn't trust the compiler to be clever enough. Fastest VI had all constant operations outside of loops...
Lessons learned from the course: Don't rely on the compiler
Thanks for confirming!
I would like to hear more about this myself since I could find no other references to this topic aside from what I posted.
This would be a good oppertunity for an NI Application Engineer to go find someone in R&D who can "lift the hood" a little more.
Ben
Humans program the computer. Therefore, I try to inject my common sense wherever possible and use the compiler's "smarts" more as a backup to anything I miss, rather than using it as a frontrunner in "making" decisions for me.
That said, I don't think anyone here is suggesting you should just assume the compiler will clean up everything, but in my opinion, it's not terribly difficult to move loop invariant code outside the loop on your own, so just try to do it from the start.
06-16-2010 08:52 AM
for(imstuck) wrote:...Humans program the computer. Therefore, I try to inject my common sense wherever possible and use the compiler's "smarts" more as a backup to anything I miss, rather than using it as a frontrunner in "making" decisions for me.
That said, I don't think anyone here is suggesting you should just assume the compiler will clean up everything, but in my opinion, it's not terribly difficult to move loop invariant code outside the loop on your own, so just try to do it from the start.
Agreed!
I have posted many times that to master LV we have to understand how our gestures and inuendos (sp?) are interpreted by the wonderful assisstant we know as LabVIEW. The more we know about the character of that assistant, the control we have over what is actually compiled.
Ben