LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

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


@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.


Do you know what you're asking here?

 

LabVIEW (and for that matter, most programming languages) doesn't deal with memory on the page level; that's for the operating system to figure out.

0 Kudos
Message 11 of 17
(1,056 Views)

Excercise -Description

 

There is a 2D array with variable dimensions (m-n-array), which I get to read every element of it - by nested for-loops, one for the lines and another for the columns. Since these arrays usually contain >10 000 entries, I have to take care about their processing time. Now I just want to eleminate the slow way (which is linewise in C++/OpenCV).

 

Pages

 

I'm talking about the memory pieces of the virtual storage of a computer. When accessing (any) variable, it automatically loads a few storage cell too, that are faster to read than if I jump to a totaly different place in memory, where I then have to read a new page, instead using the old already loaded one.

 

Now again if I create an array in C++/OpenCV the content of a page are always the columnwise elements, and because of this it's important to chose the columnwise iteration for the inner loop. Otherwise it'll always add some unnecessary overhead for each operation.

 

Now my question is, how is this done in LABVIEW

 

Thanks for your patience btw

0 Kudos
Message 12 of 17
(1,052 Views)

Why do you have to read them? So you can sum them up? So you can re-arrange them? So you can...?

0 Kudos
Message 13 of 17
(1,038 Views)

dancetobebop wrote:

Now again if I create an array in C++/OpenCV the content of a page are always the columnwise elements, and because of this it's important to chose the columnwise iteration for the inner loop. Otherwise it'll always add some unnecessary overhead for each operation.

 

Now my question is, how is this done in LABVIEW


If you nest two for loops and use auto-indexing, LabVIEW will do it in the order you want, with the inner loop processing the elements that are adjacent in memory. You would have to explicitly code the array indexing to do it in a different order. I never remember, though, whether this is rows or columns for the inner loop; when I need to know, I write a quick test to show me.

0 Kudos
Message 14 of 17
(1,009 Views)

Columns, rows, pages, books, ....   Auto-indexing works from the last items to the front.  So columns would wind up at the innermost loop (assuming 2 loops on a 2-D array)

0 Kudos
Message 15 of 17
(992 Views)

thanks.. do you have any official links with that answer, for referencing purposes ?

0 Kudos
Message 16 of 17
(966 Views)

@dancetobebop wrote:

thanks.. do you have any official links with that answer, for referencing purposes ?


http://forums.ni.com/t5/LabVIEW/Is-it-faster-iterating-columnwise-than-linewise-over-an-n-m/m-p/3187...

 

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