10-10-2018 10:36 AM
@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?
10-11-2018 06:27 PM
@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