Re: Many changes in layers and markers

On Sat, 2011-02-12 at 23:49 -0700, Robert Park wrote:
> On Sat, Feb 12, 2011 at 11:38 PM, Russell Strong <russell strong id au> wrote:
> > A call which modifies the scenegraph, for the want of a better word,
> > causes an timer function to be added to do the redraw.  Timer could be
> > set to immediately expire.  The important thing is that scenegraph
> > modification is separated from rendering.
> I don't totally follow your flowcharts here, but I think I agree with the idea.
> How things were working before was that my GPX parser would call
> ChamplainPolygon.append_point thousands of times per second, and the
> screen wouldn't redraw in this time because the Gtk mainloop hadn't
> iterated. Then every 0.2s, I'd do a "while Gtk.events_pending():
> Gtk.main_iteration()" to get the display updated and the polygon
> rendered to the screen. Things were really speedy, I could append
> 40,000 points in 6 seconds. Now it's taking 6 minutes to load those
> same points.
Yeah, I think you have followed it.  The basic idea is that all drawing,
sorting, and other expensive operations should be delayed until
main_interation, so that they can be done once instead of every time the
scenegraphs updated.  I haven't looked to closely but I think clutter
has to take some of the blame for things like sorting.

My flows just showed the event ending and getting retriggered instead of
your yielding approach, but essentially they are the same.

> Anyway, I'm in full support of any method that can be used to make
> slow code only execute when necessary, and not every single point
> added. ;-)

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]