Timing comparison for diffeq program in c++, Maple and Maxima
Subject: Timing comparison for diffeq program in c++, Maple and Maxima
From: Richard Fateman
Date: Thu, 09 Aug 2012 07:09:21 -0700
On 8/9/2012 5:32 AM, Rupert Swarbrick wrote:
> Dennis Darland <dennis.darland at yahoo.com> writes:
>> I ran a timing test comparison for c++, Maple and Maxima.
>> All three programs generated by omnisode - a set of Ruby programs.
>> Set time limit to 1 minute.
>> Maximum iteration was sufficient to solve entire problem.
>> Problem was sin.ode for all three.
>> Output was redirected to file only - none to screen
>> Results:
>> c++ solved entire problem in 23 seconds (140001 iterations)
>> Maple performed 11542 iterations in 60 seconds
>> Maxima performed 372 iterations in 60 seconds
>> That amounts to:
>> c++ 6,087 iterations/second
>> Maple 192 iterations/second
>> Maxima 6.2 iterations/second
>> c++ is almost 32 times faster than Maple which is almost 31 times faster than Maxima.
>> So c++ is almost 982 times faster than Maxima.
>>
>> More info on omnisode at:
>> http://sode.sourceforge.net/
> Right, I just tried to look up the Maxima code you're generating and
> found things like [1]. Since I'm clearly not going to read through that
> carefully, and I presume no-one else is either, can you explain exactly
> what you're measuring?
>
> Your code looks to me like a C/FORTRAN program translated to
> Maxima. Unsurprisingly, it runs very slowly. What are you actually
> trying to do? What capabilities of Maple or Maxima are you using other
> than basic arithmetic?
>
> Or should we interpret your message as
>
> "Writing bare-metal calculations in Maple and running them is
> marginally less slow that writing them in Maxima and running
> them. But it would have been easier to do it in C anyway"
>
> ?
I spent 1 minute looking at the code in [1] ... It seems to me that if
you are computing Taylor
series you should use the Taylor series command and not write something
in what looks
like C. Etc. So you are using these enormously powerful programs to
simulate very
low level operations, as Rubert says. So you should use C. And if you
want it to run
faster, consider generating assembler.
(You can make Maxima run faster by adding declarations and compiling,
but that will
probably make it no more than about 100X faster.)
>
>
> Rupert
>
> [1] http://sode.sourceforge.net/omniresults/special_cases_007/diffeq.tan_sqrt_lin.mxt.txt
>
>
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima