LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

My EXE takes about 8 times longer to run then the LLB from which it was compiled.

I am running V5.0.1. I have tried the Control-Shift-Run arrow suggested in another discussion without any improvement. The code is sorting through a large array of data in a loop using shift registers.
0 Kudos
Message 1 of 4
(2,954 Views)
Pressing control-shift-run arrow should not have made your program slower. Instead are you saying that your code runs slower after it was built than in the development environment? Do you have all your error clusters wired up and do you get an error message? Are you getting the timming for the executable on the development machine or on the target machine? It might be helpful if you stripped down your code and posted it.
0 Kudos
Message 2 of 4
(2,954 Views)
Yes, my code runs slower when built into an executable than when I run within the development library. I am running both on the development machine when comparing the timing. I tried the 'Control-Shift-Run Arrow' combination to recompile the code as this had been suggested in a previous discussion on the exchange. This made no difference.

I don't have any error clusters to wire and so don't get any error messages. The code does execute correctly - eventually. I am loading a 15M file which was taking approximately 30 minutes to load until I removed some shift registers/build array functions that appeared to be slowing my code. Currently the file takes 19s in the development environment and 2.5 minutes with the executable.

I have noticed that the
exe does not close properly after loading the large file and remains on the taskbar until closed with the Task Manager.

I have attached my code and some information.
Download All
0 Kudos
Message 3 of 4
(2,954 Views)
I could not find anything that would explain the slower performance in your code. The only thing that I can figure is that you are getting a performance hit because you build arrays in for loops. This forces LabVIEW to allocate more memory with each iteration. I suspect that the development environment has more memory avaliable to it because LabVIEW has not released it back to Windows. Instead of requesting more memory each itteration, it has enough to begin with.

You could improve the performance of your VI if you got rid of your build array functions and used an initialize array before you loops then insert the data into the array as needed. This way LabVIEW would only have to assign memory for your array once rather than n tim
es. I have attached an example to better explain.

You may also want to read "LabVIEW Performance and Memory Management" in the shipping documents. You can find it by opening LabVIEW >> Help >> search the LabVIEW bookshelf.
0 Kudos
Message 4 of 4
(2,954 Views)