Jordi Gutiérrez Hermoso schrieb:

> 2008/11/12 David Bateman <

[hidden email]>:

>

>> Jordi Gutiérrez Hermoso wrote:

>>

>>> I just ran into a "benchmark" in a blog somewhere that suggests that

>>> our expm is slower than Matlab's.

>>>

>>>

>> Jaroslav can probably do a better job at that than I can as he worked on

>> this part of the code... However, can you put us to the benchmark?

>>

>

> It wasn't anything impressive. Just ran expm a couple of times on

> rand(300), and we lost by a factor of 8 or so. I can't find it again.

> :-/

>

> I just want to confirm if we are indeed this slow. And also some

> hints, because I can't find the actual implementation.

>

> - Jordi G. H.

>

Looking for 'expm matlab octave' Google gave back this thread [1].

I ran a quick benchmark on a 1.4GHz Pentium M using today's tip and

matlab 7.6.0

matlab 7.6.0

>> M = rand(300,300);

t=0.25; T=2;

tic; inv(M) * (expm(-t*M) - expm(-T*M)); toc;

Elapsed time is 2.799052 seconds.

>> tic; inv(M) * (expm(-t*M) - expm(-T*M)); toc;

Elapsed time is 1.789023 seconds.

>> tic; inv(M) * (expm(-t*M) - expm(-T*M)); toc;

Elapsed time is 1.611524 seconds.

>> tic; inv(M) * (expm(-t*M) - expm(-T*M)); toc;

Elapsed time is 1.607993 seconds.

>> tic; inv(M) * (expm(-t*M) - expm(-T*M)); toc;

Elapsed time is 1.750429 seconds.

octave:15> clear all

octave:16> M = rand(300,300);

octave:17> t=0.25; T=2;

octave:18> tic; inv(M) * (expm(-t*M) - expm(-T*M)); toc;

Elapsed time is 4.506 seconds.

octave:19> tic; inv(M) * (expm(-t*M) - expm(-T*M)); toc;

Elapsed time is 4.303 seconds.

octave:20> tic; inv(M) * (expm(-t*M) - expm(-T*M)); toc;

Elapsed time is 4.374 seconds.

octave:21> tic; inv(M) * (expm(-t*M) - expm(-T*M)); toc;

Elapsed time is 4.457 seconds.

So, I see a factor of 2...3 for this particular code - without ATLAS if

its relevant here.

Kai

[1]

http://www.wilmott.com/messageview.cfm?catid=19&threadid=41499&STARTPAGE=2