LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Why array accesses are so slow ?

At the run-time, C stements related to arrays are very slow.
To fill a 500K entries array (of int, double, ...), it takes many seconds.
Why ?
How can I improve the array accesses ?
0 Kudos
Message 1 of 4
(3,327 Views)
You would have to post some code for us to see how you are filling the array. I created an array of 500000 ints and filled in a typical way, with a for loop. It took about my machine about 250-300 milliseconds to fill the 2MB array.

I attached the project below.

Best Regards,

Chris Matthews
National Instruments
0 Kudos
Message 2 of 4
(3,326 Views)
I am having the same problem, but it only happens in debug mode.  If I go to release mode it take the proper amount of time.  I cannot figure this out.  Am I using CVI 8.0.
0 Kudos
Message 3 of 4
(3,228 Views)
Sounds like the typical overhead of a debugger is slowing things down.  You might want to try surrounding the array initialization routine with calls to disable then re-enable SetBreakOnProtectionErrors() when executing in debug mode. 
0 Kudos
Message 4 of 4
(3,222 Views)