Jump to content

Asynchronous Call takes long time for VIT files


Recommended Posts

I was updating a reuse template of mine for asynchronously calling itself to simulate as an example for inter-process communication tests.

It took me some time to find out what was causing the first level to be slow. It seems the culprit is the reference to the VIT file.

The stripped-down template below (LV2011) launches a clone of itself everytime we press the "Launch Async" button.

Async Launch of VIT.vit

You'll notice the time required to open the reference is immensely larger when you click on the first copy than on any others.

And it scales rapidly with VI size. My full template is 184kB and takes 3.3s to load the reference. This one is 20kB and opens up in ~200ms.

Simply changing the extension to .VI solved the problem.

Is there anything I'm not doing correctly? Should this be considered a bug or a feature?

Edit: Added a small video on Jing... http://screencast.com/t/aN29fYxJw3A6

Link to comment

Yeah. Sorry. Not much for you to go on

All 1ms (LV2011x32SP1 andr 2011x64SP1 Win7 x64 and Win8 x64)

I'm getting 182 to 184ms for each launch. (XP, 32-bit, 2011 SP1)

About time you put in a capital req for a new PC :P

Edited by ShaunR
Link to comment

Perhaps with VITs, the block diagram as to be traversed to see if changes need to be made? I notice that when using a VIT, the block diagram is changed slightly, by having the reference updated to point to the new VI created rather than the original VIT. Checking the block diagram could take considerable time (215 ms on my XP-on-virtual-machine system). Making a clone, on the other hand, requires only a new data space.

Link to comment

OK.

I get 1ms accross the board (even 2011f2). This is just loading it straght up and running. However. Add the file to a project, dbl click and run-> 256 ms.

Yep, I confirm this too on my machine.

Well, this is mostly for understanding how it works under the hood, because a VIT file is not intended to run as a main program, unless in Development environment.

It's gonna end up in a palette with "Drop VI Content"...

I'll send a support ticket just to know if that's a bug or expected results like suggested by James.

About time you put in a capital req for a new PC :P

Looks like Crossrulz has the best computer after all. :shifty:

Link to comment

Why are you still using VITs for dynamic instantiation of VIs? Of course its slow! Instantiating a new VI from VIT creates a wholly independent copy of *the entire VI*. Contrast this with creating a new clone of a reentrant VI, where we only clone the dataspace and the front panel if and only if its open. We never clone the block diagram, just draw it in two separate windows.

Replicating VITs was a practice that should have largely stopped in LV 8.0 unless you are scripting new VIs as part of an actual "create me a brand new VI in the editor" tool. There are some edge cases when you're actually scripting new controls, but most UIs don't use that approach because it only works in the full dev environment, not the runtime environment. So for UI work, stick with reentrant clones.

This is why going from .VIT to .VI has an impact -- instead of copying the VIT to create a new VI, you're just cloning the reentrant VI.

Link to comment

Honestly, this is the first time I use a VIT file for instantiating VIs. (Probably first time I save a VIT file altogether!)

I naively thought I'd put my "template" in the Getting Started Window where I could call it with other templates... Isn't that what templates are all about?

Of course I'll put this VI has a "Drop VI Content" icon in the palette and will never use the GSW template... but that's not the point.

I had a perfectly working VI and when I saved it to a VIT file, I tested it one more time before packaging it and noticed it was slow on first generation calls. And by slow, I mean 3300ms! (200ms for the stripped down VI I posted above).

Copying an entire 184kb VI in memory should not take 3.3 seconds. If there is something potentially going wrong under the hood, I think it's my responsability to point it out for further investigation by the experts. Then again, it might be perfectly normal. I would not even have noticed a 200ms delay in launching the async VIs.

And frankly, I never heard of anything like "don't use VIT files anymore, they're useless". If it is an official message, then it hasn't been heard.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.