LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Exe runs way slower than VI compiled in editor

Greetings,

 

I have this unusual problem with my application that uses picture control to display a list of instructions, with different graphical elements, shapes, symbols etc. Program is made so that the picture only redraws when needed, but there is a scenario where the picture needs to redraw continuously (=animation, to be exact its drawing different portions of the list while scrolling). The problem is that in LabView IDE, the program runs fine even at 1ms loop timing while animations going, whereas built exe runs even 50x slower while animations are going on.

Using the memory and performance profiling in labview I found out that Draw Text at Point VI is taking most of the time, especially its subroutine Get Text Rect VI, and indeed removing some of the text rendering helps the executable performance with animations. Problem is that the texts need to be redrawn aswell.

I tried inlining the rendering subvi and have been messing around with different settings, i tried optimizing what I could but I still got to cca 20x slower performance. The fact that in labview the vi runs smoothly without any problem compared to the exe seems rather like some invisible setting, resources allocation etc rather than unoptimized code, but I couldn't find anything. I tried copying and renaming the labview.ini file as suggested somewhere that ini file might something to do with exe performance but no luck there either.

 

Any ideas why is this happening?

 

Thank you.

0 Kudos
Message 1 of 8
(4,142 Views)

Take your code, compress it into a single Zip file (with data, if necessary, to get it to run) and post it so we can "play with it".  Maybe we will figure it out and can share with the community ...

 

Bob Schor

0 Kudos
Message 2 of 8
(4,098 Views)

That sounds like a bug somewhere, hard to tell without seeing code.

 

Of course I question the use of a 1ms loop time for animations, because (1) the actual screen update is much less and (2) the human visual system is much slower than that.

 

Is the code absolutely identical or are any settings different (e.g. synchronous display).

 

You are also omitting quite a few other useful pieces of information, such as the LabVIEW version. Are both scenarios running on the same PC when comparing? Does the runtime version exactly match the development version (e.g. plain vs SP1, etc.). Is always only one scenario running? Does the exe remain slow or is it speeding up after a while?

0 Kudos
Message 3 of 8
(4,060 Views)

Yes, both labview and exe run on the same PC running Win 8.1, Labview 2014f1, tried to replicate on my laptop running Win 7, labview 2013, same thing happens, runs poorly on the target all-in-one PC aswell.

 

So I messed around a bit, after few unsuccessful attempts I tried to toggle from User-Defined Font to Application Font on all text drawing VIs and that seems to fix it pretty much, program runs at the desired speed without any lag whatsoever even on the target all-in-one PC (weak). So it's apparently font related. Maybe some windows settings that IDE overrides but EXE doesn't? I still need to use different fonts and such.

Message 4 of 8
(4,044 Views)

Yes, symbolic fonts (application, dialog, system) are the Achilles heel of LabVIEW because they tend to mess everything up when moving between different machines.

 

I always make a point of using only defined fonts.

 

I am glad you found the problem. Good to know!

0 Kudos
Message 5 of 8
(4,015 Views)

Well thing is that with application font, it runs fine both EXE and IDE on the same computer, once I set it to user-defined, such as Verdana I use, then the EXE runs way slower than IDE, again on the same computer, thats the strange thing about it.

Message 6 of 8
(4,010 Views)

If i set the draw text at point to application font, it runs fine and even if i set the application font to the desired font i want (Verdana 18) in the exe's ini file, it runs fine aswell. When i toggle between application font and user-specified font using a control in exe, the application slows down from 100fps to like 10fps and back to 100 when i toggle back to application font. It's clearly how text drawing VIs handle "user-specified font" setting. No idea what to do though. I could just use the ini file to override the application font to the desired one but thats rather incovenient.

Message 7 of 8
(3,951 Views)

Hi,
I have a very similar problem with LabVIEW 2016.
I use a Picture Control in wich draw text, lines, boxes using various dedicated subvi.
In my program, when I run the VI in editing mode, it takes about 170 ms to draw everything, when run the exe file it takes about 2000 ms or more to do the same things.
The critical subVi, uses the font "Wingdings 3" to draw some arrows as text into the picture.

It seems that managing pictures in LabVIEW is not so good...

From 2015 NI made something to solve this problem?

Best Regards

Franco

0 Kudos
Message 8 of 8
(3,225 Views)