octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: the competition's expm vs ours


From: Kai Habel
Subject: Re: the competition's expm vs ours
Date: Thu, 13 Nov 2008 09:46:21 -0000
User-agent: Thunderbird 2.0.0.17 (X11/20080922)

Jordi Gutiérrez Hermoso schrieb:
> 2008/11/12 David Bateman <address@hidden>:
>   
>> 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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]