Performance issue on different computers

4 次查看(过去 30 天)
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?

类别

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