Performance issue on different computers

조회 수: 4 (최근 30일)
Jette
Jette 2017년 5월 16일
답변: Jette 2017년 5월 19일
I have a very weird problem. A fellow has changed some code of our project and states that on his computer the changed code is about a factor of 100 times faster than the original code. However, on my computer I can't find a significant performance difference between both versions of the code. On my computer, both version differ at most 1%, and sometime one is faster, sometime the other.
We both use tic/toc for timing, the same test files and the same tested code. We both run MATLAB R2015b (64bit).
The piece of code deals with importing a special ASCII file format into MATLAB.
Has anyone an idea what could be the reason for this? I am absolutly perpexed about it.

채택된 답변

Jette
Jette 2017년 5월 19일
I've found the solution. It had something to do with our project library and that the fellow did not use the entire library as I expected. Somewhere in the code is a if - else where he fell into the much slower else due to a missing file in his path.
By the way - the results of the profiler where extremely misleading in this case.
Thanks you for reading and thinking

추가 답변 (2개)

Steven Lord
Steven Lord 2017년 5월 16일
Is the file that you're importing being accessed on a network drive on your machine and on a local drive (possibly an SSD) on his machine?
Is his machine newer (and have a faster disk, again possibly an SSD) than your machine?
What differences do the report of the Profiler running the code on your machine and the report of the Profiler running the same code on his machine show?
  댓글 수: 2
Jette
Jette 2017년 5월 17일
편집: Jette 2017년 5월 17일
We both work on local drives. I also tried it with network drive but don't see a performance difference between the 2 code versions in this case.
In my opinion, it should not matter which kind of local drive we have or if one computer is newer/faster than the other since I do not compare his time with my time but always 2 times on the same computer. Actually, I have a very slow computer.
I asked him to run the profiler to have a look what exactly takes so much time on his computer.
Steven Lord
Steven Lord 2017년 5월 17일
Once you have the Profiler reports, see if one of you has shadowed one of the functions included with MATLAB that shows a large performance difference with a different version. If that is not the case, and you can't determine the cause of the performance difference, post a small (~10 line) segment of the code that shows the largest difference and describe the variables used by that code (size, class, attributes, global or not global, etc.)

댓글을 달려면 로그인하십시오.


Jan
Jan 2017년 5월 17일
It sounds strange if you import an ASCII file and do not see a difference between a local and a network drive. Actually I'd expect the network connection to be the bottleneck. But perhaps you have a 1G connection without a lot of traffic.
A virus scanner can slow down the file access drastically. Disk caching can allow to read a file much faster, so this might be a question of the hardware.
Do the codes run on your computer with the faster or the slower of the versions used by your fellow?
  댓글 수: 1
Jette
Jette 2017년 5월 17일
I compare network against network and local against local.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Code Generation for ARM Cortex-M and ARM Cortex-A Processors에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by