Matlab is too slow in processing

Hello,
I have a problem with Matlab that it is too slow. My PC has 16GB RAM and the version I am using is 2021a.
I have checked the same code with another computer and it run the code much faster.
The CPU utilization shows in PC as 7-10% and if I test the same code in different computer it is like 60-65%.
And when I run 'bench' in matlab it shows my PC is having longest execution time than the other machine I tested my code though which is apperently bad in terms of properties compared to my PC.
Can anyone answer why this is happening ?

3 Comments

With the information you've given, no. You haven't told us what your code is doing.
It could be that the computation isn't the bottleneck, the bottleneck is reading your data files from a (slow) drive on this machine and a faster drive on the other.
It could be the other machine has enough memory it doesn't need to swap while this one does.
Do both machines have the same number of physical cores to perform equivalent multithreading?
Or it could be that the computations are slower on your machine. Without looking at the code there's no real way to know.
As for he bench results, show them. The bench function weights the computation and graphics tests equally, and often machines are lower on the list because the perform the 2D and 3D tasks more lowly than others they match on the numerics tasks.
Hello,
Thank you very much for your response Steven.
We could configure some major issues which had with PC settings and improve the performance. In my code, first I am trying to first read some json files from folders, and after that process it through fft , conv etc.
After the changes, the CPU utilization has improved upto 48-55% in PC. In both cases, matlab was the only software running. PC has 4 cores and laptop has 2 cores.
The properties of the other machine (a laptop) are
Matlab 2017b installed in laptop.
After the changes the bench results are: top picture is for PC and bottom picture is for laptop
What type of GPU is in both computers? If one has a GPU supported by MATLAB, the fft and conv processing could go to the GPU but not on a machine with an unsupported GPU. This could explain why one is much faster or uses the CPU less. You should also make sure background processes like backup and antivirus are not interfering with test results.

Sign in to comment.

Answers (0)

Categories

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!