Wiebe@CARYA wrote:
I'm pretty sure the benchmark was done before LabVIEW did any constant
folding... So, IMHO, it's valid, although doing the benchmark again in LV
8.x would be meaningless (don't tell me you did it anyway?).
Constant folding was done well before LabVIEW 8.0 and the extend and details varied a bit between versions. One thing that got introduced in LabVIEW 8.2 was the capability to
show where folding occurs (
fuzzy wires, fuzzy structures, see image). I have this always enabled, it is of great help analyzing code.
😉
I no longer have any pre-8.0 version installed, but it would be easy to check if there is any timing difference between a version with all diagram constants and one with some of them changed to controls.
Using a constant of 100 on the outer loop gives 0ms and changed to a control gives about 188ms in LabVIEW 8.2.1.
There are some weird things between Matts and my version, for example mine slows down if I swap the inputs to the ADD node or add an innocent explicit ToDBL conversion right before the "add" to avoid the coercion dot. This is one of the very few cases I encountered where an implicit conversion is significantly faster than an explicit conversion(!!!). It almost seems that the implicit conversion can avoid the extra buffer allocation for the DBL array right before the add node. (I still need one in the "0" case to enforce DBL type, but that's cheap because it occurs only once).
Matts solution is 50% slower in some runs for no obvious reason at all. I haven't really studied all that....
Message Edited by altenbach on
07-25-2008 08:26 AM