LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Tunnels vs Shift Registers

Solved!
Go to solution

@RTSLVU wrote:

@Mark_Yedinak wrote:

I would bet that the compiler could do a better job of optimizations when it is a tunnel since it is explicit that it will not change inside the loop. A shift register would indicate that the value might change and therefore some optimizations may not be allowed.


From what I understand anytime you have a tunnel entering a loop it pretty much negates any optimizations so SR or FN makes no difference in that aspect.


I would go for a tunnel, because it's at least as good or maybe better, and clearer to human readers.

 

The only reason for using a SR would be if the compiled code would benefit from it. I think we all agree that's not going to the case?

0 Kudos
Message 11 of 12
(296 Views)

@RTSLVU

 


Having to set the starting value inside the loop sounds like a corner case to me. 

One example is when using a fixed length queue as a pre-trigger buffer.

When you flush the queue you get an array of "chunks of data".

In the For Loop to reassemble the data, the first iteration provides the starting value.

Subsequent iterations append data.

 

steve

----------------------------------------------------------------------------------------------------------------
Founding (and only) member of AUITA - the Anti UI Thread Association.
----------------------------------------------------------------------------------------------------------------
0 Kudos
Message 12 of 12
(281 Views)