MATLAB Answers

Performance issue on different computers

2 ビュー (過去 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 件のコメント
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.

サインインしてコメントする。

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by