On Tuesday, April 17, 2012 5:52:42 PM UTC+8, Jeroen Demeyer wrote:
>
> An easy way to test this using timeit() (best out of 20 runs):
>
> sage:
>
> timeit('''plot(sin(x),(x,0,2*pi),ticks=pi/3,tick_formatter=pi).save("/tmp/1.png")''',
> number=1, repeat=20)
>

Maybe the slowdown is not in matplotlib. I have a completely separate class 
for making logarithmic plots and I don't see a slowdown there.

Below is sage-4.8
~/tmpĀ» ~/Installations/sage-4.8.good/sage
----------------------------------------------------------------------
| Sage Version 4.8, Release Date: 2012-01-20                         |
| Type notebook() for the GUI, and license() for information.        |
----------------------------------------------------------------------
sage: from logplots import log_plot                                     
sage: timeit("log_plot(exp(x), 'semilogy').save(filename='/tmp/b.png')")
5 loops, best of 3: 232 ms per loop
sage: timeit("log_plot(exp(x), 'semilogy').save(filename='/tmp/b.png')")
5 loops, best of 3: 232 ms per loop
sage: timeit("log_plot(exp(x), 'semilogy').save(filename='/tmp/b.png')")
5 loops, best of 3: 233 ms per loop
<,(x,0,2*pi),ticks=pi/3,tick_formatter=pi).save("/tmp/1.png")''',           
 
....: number=1, repeat=20)
1 loops, best of 20: 831 ms per loop


Comparing with sage-5.0beta11:

~/tmpĀ» ~/Installations/sage-5.0.beta11/sage 
----------------------------------------------------------------------
| Sage Version 5.0.beta11, Release Date: 2012-03-28                  |
| Type notebook() for the GUI, and license() for information.        |
----------------------------------------------------------------------
**********************************************************************
*                                                                    *
* Warning: this is a prerelease version, and it may be unstable.     *
*                                                                    *
**********************************************************************
sage: from logplots import log_plot
sage: timeit("log_plot(exp(x), 'semilogy').save(filename='/tmp/a.png')")
5 loops, best of 3: 195 ms per loop
sage: timeit("log_plot(exp(x), 'semilogy').save(filename='/tmp/a.png')")
5 loops, best of 3: 194 ms per loop
sage: timeit("log_plot(exp(x), 'semilogy').save(filename='/tmp/a.png')")
5 loops, best of 3: 195 ms per loop
<,(x,0,2*pi),ticks=pi/3,tick_formatter=pi).save("/tmp/1.png")''',           
 
....: number=1, repeat=20)
1 loops, best of 20: 1.05 s per loop


If you want to test yourself, the code for the log_plots file can be 
obtained from http://trac.sagemath.org/sage_trac/ticket/4529 .
 

-- 
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