Clear Filters
Clear Filters

time of execution of a code in matlab

3 views (last 30 days)
emar
emar on 12 Apr 2017
Commented: emar on 13 Apr 2017
Hello, To compare the time of execution of two functions, i wrote a code where i measure the time elapsed for each function and for each index ( with the command clock /etime). However, on my computer the first function is faster than the second, and on an other computer, it's the opposite. ( I tried several time with different indexes and with clearing for each time the data ,but it is still the same result).
Can you explain me why there is such difference?
On both of them, Matlab version is r2017a , the only difference is that on one computer, the compiler is MinGW 4.9.2 ,and on the other one it's Microsoft Windows SDK 7.1 .
Thanks in advance
  6 Comments
Stephen23
Stephen23 on 13 Apr 2017
Better options for timing code would be to use the inbuilt timeit, or the FEX submission timeit.
emar
emar on 13 Apr 2017
Even with timeit, i still have the same results.

Sign in to comment.

Accepted Answer

Jan
Jan on 13 Apr 2017
Can you find the code lines inside freqxorr which are accelereated on the faster computer. It could either be multi-threading and a higher number of cores, or the data might match into a larger CPU cache, or the internally used library can use the SSE or AVX features fo the younger processor. Nevertheless, it is not surprising, that different functions can profit differently on different CPUs.
  1 Comment
emar
emar on 13 Apr 2017
Exactly, in the first computer there is 44 cores so that's why fft2 is faster than the other computer (12 cores). Thank you for your help !

Sign in to comment.

More Answers (0)

Categories

Find more on Downloads in Help Center and File Exchange

Tags

No tags entered yet.

Community Treasure Hunt

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

Start Hunting!