performance... plot_date Vs plot

Hi: I was wondering whether anyone else has noticed a

    > performance difference between using plot_date() and
    > plot(). Here is a dummy script:

It turns out that the difference in execution times between these two
cases is explained by the fact that the default plot style for plot is
'-' and the default plot style for date is 'o'.

Drawing a long connected line is still much faster than drawing a
bunch of circles. I think if I start using collections in Line2D to
draw markers we'll see a performance boost there, but until I do it
it's hard to estimate how much.

There is a small change I can make which is to allow converter to be
None for the case in which your dates are already epoch. This will
save some cycles, but is negligible compared to the arc drawing time
in your example; from the profiler:

    60480 7.470 0.000 7.470 0.000 backend_agg.py:117(draw_arc)
    60480 0.200 0.000 0.200 0.000 dates.py:410(epoch)

But if I can get the marker performance much better by using
collections, then the conversion step will be worth bypassing.

JDH

It turns out that the difference in execution times between these two
cases is explained by the fact that the default plot style for plot is
'-' and the default plot style for date is 'o'.

Yes.. changing the style to '-' fixes the performance issue... great!

There is a small change I can make which is to allow converter to be
None for the case in which your dates are already epoch. This will
save some cycles,

Yes.. I would certainly be for it!.. But I'm biased - all my data is already epoch.. :wink:

···

--
Peter Groszkowski Gemini Observatory
Tel: +1 808 974-2509 670 N. A'ohoku Place
Fax: +1 808 935-9235 Hilo, Hawai'i 96720, USA