LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

autoindex array vs replace array subset - what is more efficient

Hi, I am just wondering what is now with the new versions of LV more efficient - autoindex or replace array subset when performing operation on array that already exists.
Message Edited by ceties on 01-19-2010 03:54 AM
LV 2011, Win7
0 Kudos
Message 1 of 11
(3,848 Views)
Here is what I mean. My test indicate that the replace array subset is still slightly faster.
Message Edited by ceties on 01-19-2010 04:01 AM
LV 2011, Win7
Message 2 of 11
(3,843 Views)

Could you upost your benchmark code that yo uused to come to that conclusion please?

 

My attempts to sped-up For loops by doing it explicitly like you have done had always failed so I came away thinking the the end condition checking was faster if I let LV do it rather than myself. I have not checked this in years so maybe something has changed.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 3 of 11
(3,816 Views)

Ben wrote:

Could you upost your benchmark code that yo uused to come to that conclusion please?

 

My attempts to sped-up For loops by doing it explicitly like you have done had always failed so I came away thinking the the end condition checking was faster if I let LV do it rather than myself. I have not checked this in years so maybe something has changed.

 

Ben


Correction!

 

Prior to LV 6i that construct was actually faster.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 4 of 11
(3,813 Views)

Don't forget that for case #1 you could simply delete the FOR loop and the code would still produce the exact same result. 😄

 

My casual testing shows that this would often be faster. Alway carefully look for buffer allocations.

 

 

0 Kudos
Message 5 of 11
(3,796 Views)

altenbach wrote:

Don't forget that for case #1 you could simply delete the FOR loop and the code would still produce the exact same result. 😄

 

My casual testing shows that this would often be faster. Alway carefully look for buffer allocations.

 

 


By "that" you are refering to tossing the For Loop?

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 6 of 11
(3,793 Views)

ceties wrote:
My test indicate that the replace array subset is still slightly faster.


It would also be important to see how you are testing this. For example the shown code is all folded because it only depends on diagram constants. You would not get realistic results. The extent of folding also depends on the LabVIEW version.
0 Kudos
Message 7 of 11
(3,789 Views)

@Ben wrote:
By "that" you are refering to tossing the For Loop?



Yes.

 

Some casual testing shows that the "no loop" version is <10% slower than the shift register version, while the autoindex version is about 2x slower.

 

I would go with the no-loop version for code simplicity. 😉

 

0 Kudos
Message 8 of 11
(3,777 Views)
Isn't this where Iteration Parallelism sees some improvement? What would that do for performance?
____
Ryan R.
R&D
0 Kudos
Message 9 of 11
(3,766 Views)
I did not configure any parallelism. So that's another possible improvement.
0 Kudos
Message 10 of 11
(3,752 Views)