LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Is it faster iterating columnwise than linewise over an n-m-Array?

Hey everyone

 

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? Would be nice if I could have some "official" links for referencing too (which unfortunately I couldn't find)

 

Thanks for the support and kind regards

0 Kudos
Message 1 of 17
(3,259 Views)

Care to be a little more specific?  Are you pulling 1 element at a time?  A row/column at a time?

 

It is sounding to me like you just need 2 FOR loops inside of each other with Autoindexing tunnels and it is all done for you.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 17
(3,244 Views)

hello and thanks for the quick reply.

 

Yes it's like you said 1 element at a time (at the moment columnwise), by 2 For-Loops. How does Autoindexing tunnels manage my page calls ? I always thought it is constantly programming-language specific

0 Kudos
Message 3 of 17
(3,240 Views)

dancetobebop wrote:  How does Autoindexing tunnels manage my page calls ? I always thought it is constantly programming-language specific

The whole array is always in memory.  A lot of these operations can even happen in place (not making copies to do the operations).


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 4 of 17
(3,227 Views)

Does Labview really put 10 000 Elements in one page ?

0 Kudos
Message 5 of 17
(3,210 Views)

Can you be a bit more specific what kind of operations you are doing in each single element? Can you show is a code example?

 

Many operations can be done directly on arrays, e.g. for better utilization of SSE instructions.

 

Also remember that elements of a row are adjacent in memory, while elements of a column are spaced apart by the number of elements in a row.

0 Kudos
Message 6 of 17
(3,208 Views)

@dancetobebop wrote:

Does Labview really put 10 000 Elements in one page ?


LabVIEW does whatever you tell it to do. All arrays are contiguous in memory, irrespective of size and number of dimensions.

0 Kudos
Message 7 of 17
(3,204 Views)

Really ? Im not that kind of an expert in computer tech. but I thought the entrys of a page is limited to just a few elements and thus it is important to know in how to access these.

 

I really don't know how to be more specific or what a code example should help, so please let me see what is still unclear. On the other hand If there really is a way to define the iteration direction and / or the page size, could you please hand me the link to the instructions ?

0 Kudos
Message 8 of 17
(3,191 Views)

@dancetobebop wrote:

 

I really don't know how to be more specific or what a code example should help, so please let me see what is still unclear. 


Explain what kind of operations you need to do on each element and what the final output should be. For example is the result a 2D array of the same size as the input array, a single number, a 1D array, something else?


@dancetobebop wrote:

Really ? Im not that kind of an expert in computer tech. but I thought the entrys of a page is limited to just a few elements and thus it is important to know in how to access these.

 


Explain what you mean by "page". From a computing hardware side, you have CPU registers, several levels of CPU cache, RAM, and possibly swap space on the HD. The size of each depend on the exact make and model of the CPU and you typically don't have to worry about any of this.

0 Kudos
Message 9 of 17
(3,183 Views)

If you need to iterate columnwise, transpose the array first, and then iterate thru the items as Crossrulz states above.  I don't understand your "page" references. 

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
0 Kudos
Message 10 of 17
(3,167 Views)