12-27-2021 07:18 AM
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
12-27-2021 10:20 AM
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.
12-27-2021 03:27 PM
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
12-28-2021 04:46 AM
Hi Altenbach,
Thanks for your response. I have listed the information below.
1. This is how I am measuring the time of my algorithm.
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.
Thanks,
NavinKumar
12-28-2021 11:20 AM - edited 12-28-2021 11:24 AM
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.
Have you watched our NI WEEK presentation from a few years ago?
12-29-2021 12:53 AM
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
12-29-2021 06:28 AM
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
12-29-2021 10:05 AM
@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?
12-29-2021 10:58 AM
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?