LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Labview Performance Lags

Hi all,

 I am facing a strange issue. I have developed a vision based LabVIEW application and my LabVIEW code lags very much in my pc compared to other low end pcs.

 

I have listed the pc specifications and time taken for executing my code in respective pcs.

 

My PC Specifications : Intel(R) Core(TM) i7-10700K CPU @ 3.80GHz 3.79 GHz, 16 GB RAM with windows 10 OS.

Time Taken - 840 milliseconds.

 

Another Laptop Specification : Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz 2.70 GHz, 16 GB RAM with windows 10 OS.

Time Taken - 630 milliseconds.

 

Another PC Specification : Intel(R) Core(TM) i5-3470S CPU @ 2.90GHz 2.90 GHz, 8 GB RAM with windows 7 OS.

Time Taken - 450 milliseconds.

 

I have tried 3 different PC benchmark and compared scores with above listed PCs where my PCs performance stands greater than other PCs.

 

Thanks,

NavinKumar

0 Kudos
Message 1 of 9
(3,692 Views)

Your execution times differ by less than a factor of two and that can depend on many factors. Unfortunately, you don't really provide any useful information.

 

  • How are you measuring the execution time?
  • How variable are these times if you do repeated measurements on the same PC?
  • Are these times for a built application (exe) or when run in the development environment?
  • If in the development environment are the front panels of  subVIs open or closed?
  • What does the slow code actually do? Do you know if it is optimized for e.g. inplaceness?
  • What else is running on each PC? (e.g. windows updates, virus scanning, etc.)
  • What drivers, modules, toolkits, and hardware is involved. For example is there communication with cameras? How are they connected (ethernet, USB, etc.).
  • When you say "lags very much", are you just talking about the listed execution times or is the UI itself sluggish to use?
  • etc.

 

 

0 Kudos
Message 2 of 9
(3,666 Views)

Are you saying that when running your vision based LabVIEW application on your PC, the performance takes longer on your machine, though other benchmarks suggest your machine should be faster? 

 

Perhaps you are comparing Apples and Oranges.  You did not specify the Application, but if it involves LabVIEW Vision, the difference may be as mundane as the nature of the display, that is, how many pixels you have to drive to run your program.  A 1920 x 1080 screen has about 1.6 times as many pixels as a 1280 x 1024 screen ...

 

Bob Schor

0 Kudos
Message 3 of 9
(3,654 Views)

Hi Altenbach,

Thanks for your response. I have listed the information below.

 

1. This is how I am measuring the time of my algorithm.

Navin168_0-1640676248488.png

2.Time may be approximate but it differs only by 10 to 50 milliseconds when I repeatedly measuring time for image processing algorithm with same image.

 

3.This problem is coming under development environment and I not yet tried in exe.

 

4.The front panels are in closed state and vis are running reentrant state.

 

5.My code performs image processing algorithms like threshold, particle filters and so. I am not using any inplace element structure and there is no way to use it here.

 

6.There is no any third party application that we need to worry about.

 

7.I have camera drivers and other NI hardware drivers installed but we are not considering it for execution time of my image processing algorithm. For now images are read directly from saved files and the image reading time also not included in the execution time.

 

8. The lag I am talking about is not about the front panel update. It is only about the time taken for the image processing algorithm and it doesn't have any third party applications like python and I use only NI image processing vis.

 

I have attached the PC details.

Navin168_1-1640687913306.png

 

Thanks,

NavinKumar

 

0 Kudos
Message 4 of 9
(3,616 Views)

Thanks for the additional details. Benchmarking is more art than science and many things can give meaningless results.

 

I never said to use the "inplace elements structure", just to avoid memory thrashing by constantly resizing data structures, for example. Correct code requires fewer expensive calls to the memory manager.

 

  • Is debugging disabled or enabled?
  • Are the compiler settings the same on all machines? (tools...options...environment...compiler).
  • I recommend the "high resolution relative seconds" instead of the ticker. Better units, especially if you use a nice format (e.g. %.3ps") for the indicator.
  • What is the CPU use during the execution of your code as seen in the task manager? (mostly one core? More?)
  • Do you use any explicit parallelization?
  • Is there any other code that can run in parallel to your timing sequences?
  • Are there any terminals, local variables, or value properties inside the timing sequence?
  • Can you show us your inner code (i.e. what's inside the middle frame)

 

Have you watched our NI WEEK presentation from a few years ago?

0 Kudos
Message 5 of 9
(3,603 Views)

Hi Bob_Schor,

 

   Thanks for the response. I have developed my code using LabVIEW vision APIs only. The time taken for executing my code is longer than other two PCs.

Yes other benchmarks suggest that my PC should be faster than the other PCs (mentioned above PCs) but in LabVIEW it is not.

 

I don't know why you are referring that I am comparing Apple and Oranges. I am using constant code and images while testing my execution time lags very much in my PC though it has higher specification than other PCs. The display resolutions are constant for all the three PCs perhaps I am not talking about any front panel updates and referring only about processing time of my code.

 

You can refer my other replies to this thread for additional information.

 

Thanks,

Navinkumar

0 Kudos
Message 6 of 9
(3,586 Views)

Thanks for the Response @Altenbach

 

1. Yes debugging is enabled for all the vi's but the code is constant factor in all the tested PC's i.e. Debug is enabled in all the tested PC's. So it shouldn't vary depend on Debugging.

 

2. In all three PC's, I didn't change any compiler settings after installing LabVIEW. In addition, I don't know what compiler settings you're specifying that can affect my PC Performance this much.

 

3. In my PC, CPU utilization ranges between 70 to 93% and speed ranges from 3 to 4.6 GHz.

I have attached the screenshot taken from task manager for further details.

 

Can you please elaborate about the sentence that you're referring about one core or more in CPU usage. I couldn't see the usage of core in Task manager where I can only able to see the CPU usage and 8 cores available.

 

4. I had used some For Loop parallelism in which it sub Vi's will be re-entrant. 

 

5.No, there is no local variable or value properties inside the timed sequence (Image Processing Algorithm).

 

6. Sorry, The code is confidential and I cannot share it. Actually it contains some vision functions like Threshold, Particle Filter, Mask, Overlay, Edge Detection and so on.

 

Thanks,

Navinkumar

0 Kudos
Message 7 of 9
(3,572 Views)

@Navin168 wrote:

Can you please elaborate about the sentence that you're referring about one core or more in CPU usage. I couldn't see the usage of core in Task manager where I can only able to see the CPU usage and 8 cores available.


You can right-click the CPU graph in the task manager and "Change graph to logical processors". Now you get a separate chart for each virtual core.

 

(Since you seem to almost max out the overall usage (>>50%), there must be more that one core involved. If only one core is used, the overall utilization cannot be more than ~12% if you have 8 cores.)

 

Can you list the cache levels and sizes for all your CPUs?

 

Still a factor of two is not much in the overall scheme of things. Your CPUs have different architectures. Do you separate compiled code to ensure it gets recompiled on each new platform?

0 Kudos
Message 8 of 9
(3,563 Views)

If you have some spare time, I would appreciate if you could run my benchmark on your various machines. This will give us some baselines. How are the power settings?

 

I still would love to see your inner code. What is the dominant datatype?

0 Kudos
Message 9 of 9
(3,559 Views)