Reputation: 1803
I'll have this LABVIEW-program, where I have to iterate over large arrays (not queues) and thus I'm interested to speed them up the best as possible.
I think I've heard for OpenCV, when reading an element, the page where this element is extracted from, contains the following column elements. That means if I'd iterate by the lines for every element I'd have to load again a new page, which obviously slows down the whole process.
Does this apply to LABVIEW programs too?
Thanks for the support and kind regards
Upvotes: 3
Views: 925
Reputation: 1986
In addition to row-then-column iteration, there are two techniques you can apply to maximize your array processing:
After that, there are other more complex designs like structured grids. There is an NI white paper that describes multi-core programming in LabVIEW, including these and other approaches, in more detail.
Upvotes: 1
Reputation: 1982
I benchmarked this. I have 100000x5 2D array. By iterating rows first it takes some 9ms from my i7 processor to complete. Iterating by columns first takes some 35ms to complete.
Upvotes: 2
Reputation: 3166
LabVIEW is row-major. If you take a 2D array and wire it to the border of a For Loop for auto indexing, the 1D arrays that you get out are the rows. Wire that into a nested For Loop to process the individual elements.
Upvotes: 2