LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with array processing !!!

Problème : Si l'on met en marche le programme (Fichier joint) avec un tableau de 10 élements, l'indice de boucle s'incrémente rapidement car le tableau est traité rapidement.
Par contre, si l'on met 100'000 éléments, l'indice de boucle s'incrémente très lentement car le tableau met du temps à être traité.
En résumé, le temps de modification d'une valeur dans un tableau dépend de la taille du tableau.
Est-ce que quelqu'un peut m'expliquer pourquoi? Merci d'avance.

Problem: If we start the program (File attachement) with an array with a dimension size of 10, the index of loop is incremented quickly because the table is treated quickly.
On the other hand, if we put a size of 100' 000, the loop Iteration is incremented very s
lowly because the table spends time to be treated.
In short, the time of modification of a value in a array depends on the size of the array.
Can somebody explain me why? Thank you in advance.
0 Kudos
Message 1 of 5
(3,035 Views)
It's due to the fact that you are displaying all those 100 000 values and updating them in the indicator on every iteration.

If you move the indicator outside of the loop so that it will only be updated when the processing is finished things will run fast.
Message 2 of 5
(3,035 Views)
Hi,

There is more time spend, because the indicator is in the loop. Every time
the screen refreshes, the entire array is send to the screen.

Regards,

Wiebe.



"V.GRAF" wrote in message
news:50650000000800000033BF0000-1075935269000@exchange.ni.com...
Problème : Si l'on met en marche le programme (Fichier joint) avec un
tableau de 10 élements, l'indice de boucle s'incrémente rapidement car
le tableau est traité rapidement.
Par contre, si l'on met 100'000 éléments, l'indice de boucle
s'incrémente très lentement car le tableau met du temps à être traité.
En résumé, le temps de modification d'une valeur dans un tableau
dépend de la taille du tableau.
Est-ce que quelqu'un peut m'expliquer pourquoi? Merci d'avance.

Problem: If we start the program
(File attachement) with an array with
a dimension size of 10, the index of loop is incremented quickly
because the table is treated quickly.
On the other hand, if we put a size of 100' 000, the loop Iteration is
incremented very slowly because the table spends time to be treated.
In short, the time of modification of a value in a array depends on
the size of the array.
Can somebody explain me why? Thank you in advance.
0 Kudos
Message 3 of 5
(3,035 Views)
Expanding on the correct answers given by Wiebe and Mads;

I suggest you conduct the following experiment.

Put a case structure around the "output array" indicator. Drop a "=0" node from the Comparison palette and wire its input from the Remainder output of your quotiant & remainder function. THe output of the "=0" drives your new case selector terminal.

Change your array size to 1,000,000 and watch your loop count.

The modifications I outlined above, will update you array indicator "once each time through" your buffer. It will be quite obvious when the indicator is being updated and when it is not.

Array indicator update are always expensive.

Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 4 of 5
(3,035 Views)
If you don't have to treat an existing array, I would recommend uisng out indexing here anyway. Its way faster than any array handling.
0 Kudos
Message 5 of 5
(3,035 Views)