LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Formula nodes and execution speed

I'm doing some numerical calculations with formula nodes, and some larger with DLLs. Speed is important in this application. My experience is that DLLs are faster by a factor of 2-20, but not always. It seems to depend on the number of calls and the complexity of the calculations, but i have not found any consistent relation.

I wonder how formula nodes are compiled, or are they interpreted in some way? What makes them fast, and what makes them slow. Formula nodes are more practical than DLLs in most cases, but it would be nice to know in a more consistent way when to use DLLs and when to use formula nodes regarding the speed of execution.

Thanks
0 Kudos
Message 1 of 2
(3,974 Views)
I thought that someone with more expertise than I would have responded by now.

I think you are right that the relationships are complex. In many cases trying your particular setup is the best way to find out.

All LV code is compiled before executing. The formula parser VIs take inputs from string variables and must interpret that data at runtime, but the regular formula node should be compiled. Several versions back I recall some discussion of the relative speed of formula nodes versus coding the same functions with math primitives. If I recall correctly the primitives usually were slightly faster, but again it depended on the formula. Also look through the math function palettes. Many of the functions have been coded for speed. If the functions you need
are available or easily produced by combining a few standard modules, the speed may be adequate.

Watch handling of large arrays. If copies are required or memory reallocation occurs during the calculations, things slow way down.

Lynn
0 Kudos
Message 2 of 2
(3,974 Views)