LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Speeding up a dot product

I need to take the dot product between two large arrays (10 million doubles each). I use the Dot Product vi. This takes around 900 ms. In my view this is very slow. In Igor (an analysis and graphing program we use) this same operation takes only 23 ms.

 

Is there a way to speed up this operation?

 

I'm using LabView 2014.

0 Kudos
Message 1 of 4
(3,121 Views)

I just ran the dot product on two 10M size arrays of random numbers and it takes 10ms.

With 100M size arrays, it takes 100ms... seems to be directly related to the array size at 1ms per 1M points.

DotProd.png

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


0 Kudos
Message 2 of 4
(3,115 Views)

I recreated your vi and you're correct. My test vi was a lot like yours, but I had the wires from the random number generators entering the center frame of the sequence, so the time for generating the numbers was included in the time between the clocks.

 

Anyway, it's good to know that the dot product is fast and that I can continue with my project!

0 Kudos
Message 3 of 4
(3,093 Views)

The funny thing is mine was like yours at first, too, and I was seeing 200ms. When I was playing around with it, I noticed my mistake and fixed it before posting. Easy mistake and another reason sequence structures can cause problems easily.

 

Thanks are best given in the form of Kudos and Marked Solutions (Unofficial Forum Rules and Guidelines). You received assistance from some top-tier LabVIEW experts in your other posts, whom I'm sure would appreciate your gratitude. Marked Solutions help others find this post when they have the same issure and Kudos motivate us all to keep coming back to help! Smiley Wink

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


0 Kudos
Message 4 of 4
(3,088 Views)