SourceForge logo
SourceForge logo
Menu

Re: [matplotlib-devel] Native backend for Mac OS X

From: Michiel de H. <mjl...@ya...> - 2008年12月19日 08:20:37
> This looks great -- in particular I am intrigued by the
> final timing results which show your backend 12 times
> faster than tkagg. I am not sure where this speedup is
> coming from -- do you have some ideas?
In this example, I am drawing 16 subplots in a 4x4 grid. With Tkagg, I am noticing that the first few subplots appear quickly, but subsequent subplots get slower and slower. I think that this is due to how the event loop works. In my understanding, tkagg redraws the window when a subplot is added. So to draw subplot 16, tkagg also needs to redraw subplots 1..15, causing the progressive slowdown. The native backend draws all 16 at once, and draws each of them only once. Using plot() instead of bar() doesn't really make a difference; the same slowdown happens there with the agg backends.
In principle, it should be possible to avoid these redraws with the agg and other backends, but it depends on how much of the underlying event loop is exposed by Tkinter/gtk/wx. Basically, instead of calling figManager.show() from draw_if_interactive(), we'd have to call it from inside the Tkinter/gtk/wx event loop just before the event loop starts waiting for events. However, it depends on whether the functionality to insert calls into the event loop is available on Tkinter/gtk/wx.
> Since the new macosx backend was released in 0.98.5, I also
> need to decide whether this patch belongs on the branch, and hence
> will get pushed out as early as today in a bugfix release when some
> changes JJ and Michael are working on are ready, or the trunk, in
> which case it could be months.
> .... I'm in favor of branch, ...
Me too. :-).
--Michiel
> 
> JDH
> 
> 
> On Tue, Dec 16, 2008 at 6:08 PM, Michiel de Hoon
> <mjl...@ya...> wrote:
> > Dear all,
> >
> > I have now implemented the draw_path_collection,
> draw_quad_mesh, and draw_markers methods in the Mac OS X
> native backend (see patch 2179017 at
> >
> http://sourceforge.net/tracker/?func=detail&atid=560722&aid=2179017&group_id=80706).
> Some timings are below. In terms of raw drawing speed, the
> native backend can be either faster or slower than agg. On
> the other hand, the native backend can be considerably
> faster if the agg backend uses many calls to draw(); the
> native backend can avoid these superfluous because it has
> complete control over the event loop (see the third example
> below).
> > # Timings in seconds
> > # n Mac OS X TkAgg
> > # 2 2 6
> > # 3 3 23
> > # 4 5 66
> >
> >
 

View entire thread

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.
Thanks for helping keep SourceForge clean.
X





Briefly describe the problem (required):
Upload screenshot of ad (required):
Select a file, or drag & drop file here.
Screenshot instructions:

Click URL instructions:
Right-click on the ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)

More information about our ad policies

Ad destination/click URL:

AltStyle によって変換されたページ (->オリジナル) /