LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

CVI 8.0 is running slower than 6.0. Is there a fix?

I create a DLL in my application.  The application runs about 25% slower when I compile with CVI 8.0 rather than 6.0.  This seems to be consistent with other posted messages I've seen.  This is unacceptable for my application.  Is there a way to get it to run faster?
0 Kudos
Message 1 of 11
(4,960 Views)

You may need to use an external compiler from Microsoft, Borland, or Intel. These are optimizing compilers, and hence potentially much faster. I believe some/all are free downloads.  

I have not used external compilers, but CVI Help under "external compilers  ... creating optimized code using" should be a good start.

Hope this helps.

--Ian

0 Kudos
Message 2 of 11
(4,921 Views)
Hello eve_car,

Usually, new versions of CVI are adding more functionality, and therefore generally it takes longer to launch the environment, create debuggable executables, etc. This speed decrease happens at a slower rate than the increase in computer speed, resulting in a net gain if you upgrade their computer on a regular basis. However, if you use the same computer, you will notice a speed decrease.  Now this speed decrease should not be as dramatic if you are running in release mode.  Are you seeing the 25% decrease in release mode or in debug mode?

With LabWindows/CVI, the change in speed will depend on the functions you are using in your code.  There are various reasons for changes in speed dependent on which versions of CVI you are comparing (some of these reasons include multi-threading capaibilty, etc).

There are a few things you can do to decrease your execution time:
  • Change your Sleep Policy to Sleep Some or Do Not Sleep. This option is available under Options » Environment in the project window.
  • Reduce the debugging features in your program. These options are available under Options » Build Options in the project window. You can change the level of debugging to No Run Time Checking, Standard, or Extended. The Extended level takes the most processor time. You can also decrease the Compiler Warnings and Errors that are chosen in the same window.
  • Also as previously suggested, with LabWindows/CVI 8, you can compile the release version of your code with a third party compiler from within the CVI environment.  Based on the capabilities of the compiler you choose, you can optimize for speed, space, etc.
Hope that helps.

Wendy L
LabWindows/CVI Developer Newsletter
0 Kudos
Message 3 of 11
(4,909 Views)
Have you been able to narrow down which functions exactly are performing more slowly? I certainly would not have expected a 25% decrease in speed so I'd be very curious to find out what exactly has become slower.

Luis
NI
0 Kudos
Message 4 of 11
(4,905 Views)
Thanks for all your input.  Wendy L: I have tried the "Do Not Sleep" with no difference in the results. Also, I am running a release DLL so the debug changes are not possible.  
 
Do any of you know if the previous upgrade (7.1?) has similar slow-down problems?
 
Also, is there anyone that has tried the external compiler?  That may be my next step, and I'm just wondering if I'll have to do some code rewriting? 
0 Kudos
Message 5 of 11
(4,868 Views)
Hello eve_car,

So I'm not sure exactly which functions you are using so I couldn't give you a conclusive answer as to whether or not you will see better performance in CVI 7.1.  As mentioned by Luis, a 25% decrease in performance is not expected behavior, so are able to isolate the slow down to particular functions that are significantly slower in CVI 8?

Thanks
Wendy L
LabWindows/CVI Developer Newsletter
0 Kudos
Message 6 of 11
(4,835 Views)

Hello eve_car,

So I noticed that you have created a service request on this issue.  After reading your notes, it seems like the faster application was built in CVI 6.0 with an older version of the IMAQ driver.  Is this application running on a machine with the CVI 6 runtime engine on it, or is it running on a machine with the CVI 8.0 runtime engine on it?  Short of rebuilding your application in CVI 7.1, you might save your CVI 6 runtime engine in a backup location (System32\cvirte.dll) and then install the CVI 7.1 runtime engine to see if your application still runs at the same speed.  If it does, then you might want to try updating your runtime engine to CVI 8, to see if that makes a difference.

If after installing the CVI 8 runtime engine and you see no performance changes with your CVI 6 compiled application, you pretty much have shown that it's not a CVI runtime upgrade issue.  If this is the case, you have two other culprits to look at: the update to the IMAQ driver, or the update of the CVI IDE.  I notice you also using some additional software, which might have an affect.

Well let me know how this goes so we can isolate why the slowdown is occuring.

Thanks

 
Wendy L
LabWindows/CVI Developer Newsletter
0 Kudos
Message 7 of 11
(4,830 Views)

I am a little confused about the runtime engines.  I see from the links that 8.0 has a RTE separate from the regular CVI 8.0.  Since my production machine does not have CVI loaded, I've typcially copied the cvirte file and folder from the computer on which I built the DLL to the system32 folder on the production computer.  It seems to me that if I tried to mix up rte's with dll's compiled on different versions, it created problems.  I will try doing this again to verify.  In the meantime, if you can explain what the rte is doing, it may help me understand my options better.  Thanks. 

0 Kudos
Message 8 of 11
(4,793 Views)
Hello eve_car,

So when you install the CVI development environment, you automatically install the CVI Runtime Engine, which updates the CVIRTE.dll file on your machine amongst other things.

You can also choose to just install the runtime engine from the site in my previous post.  The typical uses cases for this is if you are deploying to a machine without the development environment on it or if you have an older version of CVI, and would like to upgrade your runtime engine to apply various fixes.

I would recommend actually running the runtime engine installer instead of simply copying the CVIRTE dll to your production machine, because the CVIRTE.dll is not the only file that gets updated from version to version.  So if you are just deploying the executable to another machine, then installing the runtime engine on your other machine, then copying over the EXE should be sufficient.  If you want to deploy additional files, you might consider creating a distribution kit, where you can automatically include the runtime engine, your application, and any additional files into one installer.

I hope that clarifies things.
Wendy L
LabWindows/CVI Developer Newsletter
0 Kudos
Message 9 of 11
(4,785 Views)

I have now tried the CVI 8.0 runtime engine with both compiled programs and 3 NI-IMAQ drivers.  My conclusions are that the slowdown is not being caused by CVI 8.0, but by the new IMAQ drivers.  I'll explain what I've done and seen.  Please see if you come to the same conclusions, and tell me if there are any other possible causes.

First, I compiled my program to create my DLL in the following ways:

1.  CVI 6.0 with NI-IMAQ 2.6

2.  CVI 8.0 with NI-IMaq 3.1

3. CVI 8.0 with NI-IMAQ 3.5.1

I ran all three versions of this DLL on my production computer with CVI RTE 8.0 and NI-IMAQ 2.6 and the two test measurements ran in 3 seconds and 5 seconds, respectively.

I then ran all three versions of the DLL with NI-IMAQ 3.1 and with NI-IMAQ 3.5.1.  In every case, my test measurements ran in 5 seconds and 7 seconds.  (3 compared with 5 and 5 compared with 7).  I did these measurements multiple times with the same results.

The only other possible explanations I can think of for the slowdown are that (1) perhaps one or both of my PCI-1407 boards has some incompatibility with the new drivers (I use two boards on my production computer), or (2) the new NI-IMAQ drivers have a problem with my older version of the Vision libraries (5.0).  As I mentioned earlier, I am extremely reluctant to purchase the new upgrade since I use such a small subset of your vision libraries.

Thanks for any help you can give me. 

0 Kudos
Message 10 of 11
(4,729 Views)