On 4/17/12 8:00 PM, Dan Drake wrote:
On Tue, 17 Apr 2012 at 11:32AM +0200, Jeroen Demeyer wrote:
Now that we're (hopefully) nearing the sage-5.0 release, I am doing
some timings again. We don't yet have proper automatic timing testing,
but with some simple scripting I discovered that plotting has severely
slowed down. I haven't figured out precisely why.

For example the following command (inspired on a doctest from
devel/sage/sage/plot/plot.py):

sage: time
plot(sin(x),(x,0,2*pi),ticks=pi/3,tick_formatter=pi).save("/tmp/jdemeyer/1.png")

Here are timings on sagenb.kaist.ac.kr, using "timeit(above plot command)":


sage-4.7.2 1 loops, best of 20: 859 ms per loop
sage-4.8 1 loops, best of 20: 851 ms per loop
sage-5.0.beta1 1 loops, best of 20: 1.21 s per loop
sage-5.0.beta2 not available
sage-5.0.beta3 1 loops, best of 20: 1.21 s per loop
sage-5.0.beta4 1 loops, best of 20: 1.27 s per loop
sage-5.0.beta5 1 loops, best of 20: 1.2 s per loop
sage-5.0.beta6 1 loops, best of 20: 1.21 s per loop
sage-5.0.beta7 1 loops, best of 20: 1.22 s per loop
sage-5.0.beta8 1 loops, best of 20: 1.21 s per loop
sage-5.0.beta9 1 loops, best of 20: 1.26 s per loop
sage-5.0.beta10 not available
sage-5.0.beta11 1 loops, best of 20: 1.22 s per loop
sage-5.0.beta12 1 loops, best of 20: 1.22 s per loop
sage-5.0.beta13 1 loops, best of 20: 1.22 s per loop

So we need to look at the prealphas (which I don't have built) and see
what happened between 4.8 and 5.0.beta1.

Can you try commenting out these 2 lines in plot.py:

# tight_layout adjusts the *subplot* parameters so ticks aren't cut off, etc.
        figure.tight_layout()

in the current beta and seeing if that fixes the problem? I could see that line causing a slowdown, as it is adjusting things so that images look nicer (i.e., things don't get cut off, etc.)

That line was added in beta0 along with the matplotlib upgrade.

Thanks,

Jason


--
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org

Reply via email to