[Maxima] slowness is repeated Maxima evaluations?
joosteto at gmail.com
Mon Dec 8 04:48:29 CST 2008
2008/12/6 Robert Dodier <robert.dodier at gmail.com>
> On 12/6/08, David Joyner <wdjoyner at gmail.com> wrote:
> > (1) Sage calls Maxima and asks it to do lots of definite integrals
> > (about 30 in this case, each involving a sine or cosine) - these are the
> > Fourier coefficients,
> > (2) Sage multiplies each of these coefficients by a sine or cosine
> > and adds them up - call this finite sum f(x),
> > (3) Sage calls Maxima to evaluate f(x) at lots of points to plot the
> > (maybe 100 point-wise evaluations of f(x)),
> > (4) calls matplotlib to create the plot of f.
> OK, I hope the following script (see PS) follows these steps.
> > This was repeated (for timing purposes) 10 times. In an example
> > about 30 terms, the first took about 10-11 seconds, and repeated
> > evaluations took longer and longer, with the 10th taking about 30-35
> With the script as shown in the PS, I don't see an increase of
> run time over 100 iterations. It takes about 16 seconds (varies
> between 15.something to 17.something) with Maxima 5.17.0 + Clisp 2.46
> on CentOS Linux, 3.4 GHz Intel x86.
As I saw matplotlib/pylab being mentioned, in combination with slowdowns, I
thought I'd mention that plotting in pylab itself goes progressively slower.
On a system here, running the following:
for i in range(n):
pylab.plot(range(m), [pylab.sin(pylab.pi*j/(m+0.0)) for j in range(m)])
print "plotting took %f sec"%(time.time()-start)
Will print "plotting took 0.051967 sec" for the second run (first goes
slower), but then the time to plot the next plots goes slowly up, to about
0.55 sec after 300 plots.
This is using Debian etch, python-matplotilb 0.87.7-0.3, python 2.4.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Maxima