11-26-2021 03:30 AM
Hello,
I have developed a data processing program (Main program is "Traitement.vi") in which I display the data on two graphs. Depending on whether I display the data by using classicals graphs (left graphs) or Sub Vi (on the right), the processing speed decreases with the second method (see i For Loop indicator). I do not understand this fall of speed.
In attached file you have the different VI and some to test it.
Thanks for your help.
Djamel
Solved! Go to Solution.
11-26-2021 06:02 AM
Why do you have a sub VI (SSVI position curseurs vpr.vi) and then a copy of the code (SSVI 2 graphes V3.vi).
Straightening the wires might make the data flow faster. (It won't, but it will become a lot easier to find problems).
How much data is there? The sub VI (SSVI position curseurs vpr.vi) won't need a copy, the data in it's indicators will not even be updated if the VI is closed, and copies are avoided.
For SSVI 2 graphes V3.vi however, the indicators are now on an open front panel. This means potentially copies will be made for the indicators, and the indicators will be updated. The indicators are outputs of the VI, so even another copy might be needed.
If there's a lot of data, this will become significant.
11-26-2021 06:32 AM
Hello,
The Sub VI SSVI position curseurs vpr.vi is on the first version of my program. At the end, I intend to use only the version with SSVI 2 graphes V3.vi. I put the two version only to show the slowing effect with using SSVI 2 graphes V3.vi.
File called harmo*.txt contain 1600 points.
I don(t understand your remark "For SSVI 2 graphes V3.vi however, the indicators are now on an open front panel. This means potentially copies will be made for the indicators, and the indicators will be updated. The indicators are outputs of the VI, so even another copy might be needed."
11-26-2021 06:58 AM
@Djamel_LFC wrote:I don(t understand your remark "For SSVI 2 graphes V3.vi however, the indicators are now on an open front panel. This means potentially copies will be made for the indicators, and the indicators will be updated. The indicators are outputs of the VI, so even another copy might be needed."
I'm not sure how to say it in another way.
The old solution had a sub VI, with it's front panel (usually) closed so the data will simply flow out as pointers. No data copies are made.
The new solution has data displayed, and connected to the connector pane. Both might cause data copies, slowing things down.
Again, how much data are we talking about?
How much slower is the new version?
11-26-2021 07:29 AM
A file contains 1600 lines. So the upper graph draws 1600 values for X and same for Y (see attached file). Same thing for the lower graph.
The For Loop tooks 1 second in one case and about 20 seconds in the second case
11-26-2021 08:08 AM
I forgot the attached file
11-26-2021 08:12 AM
Why do you insert the VI every iteration of the loop? Wouldn't once before the loop be sufficient?
11-29-2021 08:08 AM
Hello Yamaeda,
Many thanks.
It works with your solution.
Have a good day.
Djamel
11-29-2021 09:31 AM
From this we can learn that Insert VI is a costly operation, especially if not properly teamed with a RemoveVI. 🙂
11-30-2021 02:39 AM
@Djamel_LFC wrote:
Hello Yamaeda,
Many thanks.
It works with your solution.
Have a good day.
Djamel
This doesn't make any sense.
Why is the for loop unbundling exactly the same thing N times?
It seems to me that executing the sub VI only once, not N times, might have some effect on execution time..