Filter löschen
Filter löschen

time of execution of a code in matlab

3 Ansichten (letzte 30 Tage)
emar
emar am 12 Apr. 2017
Kommentiert: emar am 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 Kommentare
Stephen23
Stephen23 am 13 Apr. 2017
Better options for timing code would be to use the inbuilt timeit, or the FEX submission timeit.
emar
emar am 13 Apr. 2017
Even with timeit, i still have the same results.

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Jan
Jan am 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 Kommentar
emar
emar am 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 !

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Downloads finden Sie in Help Center und File Exchange

Tags

Noch keine Tags eingegeben.

Community Treasure Hunt

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

Start Hunting!

Translated by