‎10-31-2007 11:01 AM
@Ben wrote:
The two For loops show that the top input to an "add" can re-use its input buffer.
No, the timing difference between the loops stays the same, even if youy swap the inputs (remember ctrl+click swaps the inputs;)). The later loop is always faster.
I don't know why... 😮
‎10-31-2007 11:04 AM
In LV 7.0 the input to the adder does make a difference.
It looks like they have enhanced the adder to be ambidextrous.
They used to touch on the top input being more efficient back in the LV 5.0 version of LV Advanced.
Ben
‎10-31-2007 12:03 PM
‎10-31-2007 01:06 PM
Maybe it was slow after the reboot because windows or your antivirus was checking fur updates in the background. Make sure windows if fully loaded and CPU is zero for a while before starting to test.
How much RAM do you have? What kind of CPU? Can you monitor the swap file usage?
Have you resaved the VI locally before running it to make sure it is correct for your OS and exact LabVIEW version? What is your OS?
‎10-31-2007 01:18 PM
@altenbach wrote:
After that the times are (top to bottom) 168, 185, 169 (debugging disabled)..
Sorry, I thought you were predictable and would place the timing indicators in the same top-to-bottom order as the algorithms. 😉 I did not look close enough. These numbers are in the order of the FP (top to bottom).
So.... Yes, the primitive is slightly slower and the two loops are exactly the same (within error). Now things make sense. 🙂 There shouldn't be any difference between the loops.
‎10-31-2007 01:25 PM
@altenbach wrote:
More specifically, it seems that 7.0 folds the primitives only. Folding of structures came in later versions.
Yes, Folding of Structures came from 8.x, I think...
But what does it exactly do?
‎10-31-2007 01:30 PM
‎10-31-2007 01:39 PM
‎10-31-2007 02:10 PM
@parthabe wrote:
But what does it exactly do?
See the section "constant folding" at the following link:
http://zone.ni.com/reference/en-XX/help/371361D-01/lvconcepts/block_diagram_objects/
Basically, if a an operation has all constants as inputs, it is sufficient to store the end result, because it can never change. The actual code can be optimizede away.
Here's one example:
See: http://forums.ni.com/ni/board/message?board.id=170&message.id=202657#M202657