LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Replace Array subset is slower than build array

Hi all,

I have tried to speed up some data processeing code by exchanging a Build 2D array + autoindexing to 3D -layout by an Initialize 3D Array + Replace Array Subset -layout, and it went slooooow.

I tested the to layouts with 300 files resulting in a 3D Array output of 5 x 300 x 1600 in size  (5 channels, 300 files, 1600 samples).

The first layout used 8 seconds, and my 'improved' layout used 30 seconds(!).  I thought using 'Replace...' would speed up things, but no.

Is there a better way of doing this, that is faster than my first layout?

Actually I may want to process 1500 files, not only 300 as described here, and then waiting one minute for LabVIEW to finish is way too long.

 

Build 2D array + autoindexing to 3D:Build 2D array + Autoindexing.jpg

 

 

Initialize 3D Array + Replace Array Subset:

Initialize 3D Array + Replace Array Subset.jpg

0 Kudos
Message 1 of 3
(855 Views)

We cannot debug images. Do you have some simple code that shows the two code alternatives?

 

(way too many things are not visible, but the fast version seemingly calls the subVI with a 2D array while the slow version calls it with a 3D array. What are the dimension sizes?)

0 Kudos
Message 2 of 3
(821 Views)

Try this quick fix.

 

On your Replace Elements variant, use shifts registers for the input/output of the 3D array. (In the subVI) In your picture you are just sending the array in and having it output, there may be a buffer copy hiding in there.

 

mcduff

0 Kudos
Message 3 of 3
(816 Views)