LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Strange Time Penalties by Open/Close Reference in specific Project

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:

 

 i1.png

Well, now I have one SubVI in Library and another one outside of the library:

 

i2.png

Now I'll to open/close references to both VIs (with full path):

Something like that:

 

i3.png 

 

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.

Message 1 of 7
(2,569 Views)

interesting....

I see you are not using auto-populating folders.  What does the project structure look like in file view?


"Should be" isn't "Is" -Jay
0 Kudos
Message 2 of 7
(2,548 Views)

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.


___________________
Try to take over the world!
0 Kudos
Message 3 of 7
(2,536 Views)

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.
0 Kudos
Message 4 of 7
(2,524 Views)

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:

 

i5.png

 

And now still have penalties:

 

i5.png

 

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.

 

i6.png

 

Andrey.

 

0 Kudos
Message 5 of 7
(2,521 Views)

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.


___________________
Try to take over the world!
0 Kudos
Message 6 of 7
(2,515 Views)

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:

 

i9.png

 

 

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:

 

i10.png

 

Now the time for start decreased back from minutes to seconds :).

 

Andrey.

 

0 Kudos
Message 7 of 7
(2,508 Views)