01-20-2010 11:10 AM
Colleagues,
I've just got something interesting in my project.
I have project with library and inside of the library virtual folder with 1000 files:
Well, now I have one SubVI in Library and another one outside of the library:
Now I'll to open/close references to both VIs (with full path):
Something like that:
The problem that for open/close ref to SubVI.vi LabVIEW needed approx 4-5 ms on my pc.
But for open/close SubVI in Library.vi - time much bigger - up to 700 ms!
And this time depends from the amount of files in virtual folder. If you will reduce number of files to 500, then time also decreased to 300 ms.
It seems to be that library loaded to the memory completely for every call.
Right now I have replaced Open VI Reference with according method and obtain VI refs from he project which is much faster, but something is definitively wrong.
Test project in attachment.
with best regards,
Andrey.
01-20-2010 12:57 PM
interesting....
I see you are not using auto-populating folders. What does the project structure look like in file view?
01-21-2010 01:47 AM
When you load a VI in a library, LabVIEW loads the library into memory. When LV loads a library into memory, it also loads all the VIs in it into memory (something to consider when you're using any kind of library - all the members of the library are loaded even if you only use one. When you build an EXE you can opt to remove unused members).
The files in your folder are not LV files, so I would assume LV would not have a reason to try and load them, but I guess it iterates over them anyway and tries. The reason you wouldn't see this with a static reference is that a static reference loads the VI (and thus the library) as soon as the calling VI is loaded.
01-21-2010 05:15 AM
Jeff Bohrer wrote:interesting....
I see you are not using auto-populating folders. What does the project structure look like in file view?
I using LabVIEW for preparing installer (which is included my application, Run-Times, and other my own files such as language files, settings files, etc), so I have added all necessary files into project for deploying together, it is very convenient for me.
01-21-2010 05:25 AM
tst wrote:When you load a VI in a library, LabVIEW loads the library into memory. When LV loads a library into memory, it also loads all the VIs in it into memory ...
Its ok. But it seems to be that not only libraries, but whole project loaded every time.
For example, I will place my virtual folder out of library:
And now still have penalties:
Take a note that now we have 110 ms vs 700 ms in the example above.
Another important point:
The first example (where virtual folder placed inside of lvlib) running absolutely same in LabVIEW 8.6 and LabVIEW 2009.
The second example (where virtual folder placed in root outside of lvlib) will run in 8.6 FASTER. There are no time differences in LabVIEW 8.6.
Andrey.
01-21-2010 05:45 AM
I ran your example in 2009. Here are my results. The times are all rough averages.
Folder in project
Load project VI: 25 ms.
Load lib VI: 40 ms.
Folder in library
Load project VI: 25 ms.
Load lib VI: 700 ms.
As you can see, having the folder in the project doesn't affect the load time of the project VI. The library VI takes longer to load anyway (presumably because the library has to be loaded as well even if only has a single VI) and with the files, takes considerably longer.
01-21-2010 07:12 AM
tst wrote:I ran your example in 2009. Here are my results. The times are all rough averages.
...
As you can see, having the folder in the project doesn't affect the load time of the project VI. The library VI takes longer to load anyway (presumably because the library has to be loaded as well even if only has a single VI) and with the files, takes considerably longer.
After restart I've got the same values as your.
The reason behind penalties is disk activity which can be monitored with File Monitor:
There are some differences between LabVIEW 8.6 / LabVIEW 2009. I have realtive big projects and I obtain the references to lot of SubVIs by start ("PlugIns architecture"). Time for start my whole project in LabVIEW 8.6 was 15-20 seconds and it was increased to 2-3 minutes with LabVIEW 2009. After some experiments I have found, that this caused by opening references to VIs from libraries, which also contained non-labview files.
The workaround which I using right now looks like this:
Now the time for start decreased back from minutes to seconds :).
Andrey.