On Jan 15, 2008 7:46 AM, Michael Droettboom <[EMAIL PROTECTED]> wrote:
> Ah -- just thought of something else.
>
> If I adjust simple_plot_fps.py to have 100,000 data points rather than
> 1,000 I see something that starts to match with what you're seeing:
>
> GtkAgg:
> wallclock: 4.23297405243
> user: 3.33
> fps: 23.6240522057
>
> Gtk:
> wallclock: 15.0203828812
> user: 14.92
> fps: 6.65761990165
>
> TkAgg:
> wallclock: 4.8252530098
> user: 4.67
> fps: 20.7243018754
>
> You can see that the Gtk time is starting to explode.  If I go to
> 1,000,000 points, Gtk runs out of memory before the first plot, whereas
> the other two continue to chug along at a reasonable pace.
>
>  From looking at the code, I suspect the crucial difference is that the
> Gdk backend uses the Python sequence API (rather slow) to access the
> data as it gets rendered, whereas GtkAgg uses the numpy array interface
> which is essentially raw access to a C array.

This is not likely to be the culprit -- for drawing markers, the old
matplotlib API made a separate call to draw_polygon for every marker,
with a new gc each time.  Many moons ago, we implemented draw_markers
as a renderer method to avoid this problem.  For hundreds of thousands
of markers, we saw performance benefits of 25x to 100x.  The backends
which implement draw_markers (Agg and PS) get the benefits, but the
other backends which did not are still slow. Basically it is a problem
with a lot of redundant function call overhead.   The backend_bases
renderer method _draw_markers discusses this a little bit (it is
underscore hidden).

My guess is this difference will not be so pronounced on the trunk.

JDH

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to