LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

When init large array in class code gets slow

Solved!
Go to solution

Hello,

 

I made some code to generate sound now I want to create a delay.

The code is object oriented, first I run the init where I initialize an array of 441000 doubles.

Even if I don't change values of the array my code is much slower.

 

When I change from 440000 to 1000 then it is faster.

 

So why is the code execution slower when I initialize an array of 441000?

 

 

0 Kudos
Message 1 of 3
(2,056 Views)
Solution
Accepted by topic author InspectorGadget123123

I think this is because labview's by value means that objects are duplicated frequently. Others can probably comment better than me on if this is the case.

 

One work around could be to use a data value reference (DVR) to pass the reference to a data set rather than the whole data set itself.

CLA - Kudos is how we show our appreciation for comments that helped us!
Message 2 of 3
(2,032 Views)

Hello Max

 

Thank you for you comments!

By using DVR the problem is solved!

 

I never knew about this function and it's very interresting.

Now it really flies!

0 Kudos
Message 3 of 3
(2,019 Views)