Re: (severe) performance issues



I hadn't tried that as I assumed that it was off by default unless
enabled..

Since a simple test program doesn't show it,.  but my app does and
the performance hogging goes away when I comment out one line
(gtk_label_set_text) the problem appears to be internal to GTK> 
Another fine fellow suggested it may be due to resizing of widgets
caused by the label update, and showed me a way to set it to a
fixed size,  but that ahd no effect on cpu usage (still high).

I managed to create a workaround by useing a GtkEntry instead, and
working out some trickery to make the entrie's background color
(normally white) to match it's parent so it blends in and looks
like a label, and presto, cpu usage went from 40-45% down to 4 %.

For some reason in my case the label  updates seem to be triggering
some internal stuff for no good reason. when I get a little time
I'll try to extract that section of code int oan isolated test
case, and if it still shows that I'll file it as a GTK+ bug.
(Again)

NOTE these problems (high cpu) exist on both linux and Win32
platforms, as my app goes both ways.


--- Paul Davis <pjdavis engineering uiowa edu> wrote:

> On 3/25/07, David J. Andruczyk <djandruczyk yahoo com> wrote:
> >  Has anyone else noticed excessive cpu usage when updating
> certain
> > GTK+ (2.10.x) widgets?
> >
> > I have a piece of software that updates a set of text fields
> > (GtkLabel's) and uses progress bars to indicate a quantity
> > graphically, and am finding excessively high amounts of CPU
> usage
> > when these calls are made.  Commenting out calls to
> > "gtk_label_set_text" and "gtk_progress_bar_set_fraction" 
> brings
> > cpu usage back to near zero levels..  I have profiled my code
> > extensively using gprof/memprof and the problem is not inside
> of my
> > own code fro mwhat the profiler tells me.
> >
> > I would NOT expect updating approx 10 labels perhaps 5-10 times
> per
> > second (ie. when data chages) on a 1.8Ghz machine be so cpu
> hungry.
> >  I have code in place ALREADY to prevent unnecessary updates.
> > Without that bit of code, cpu usage will easily max the machine
> > even at lower update rates.
> >
> > I can only suspect that it's an internal GTK+ or pango issue,
> as my
> > own custom widgets (custom automotive gauges, i.e.
> > http://megatunix.sourceforge.net/cluster.gif) are far more
> > graphically intensive and I can have multiple instances (about
> 4-6
> > updating at any one time for this informal test) of them
> updating
> > at 30x per second and only have a minimal cpu load of about 15%
> >
> > Does the label or progress bar code use
> > gtk_widget_invalidate_region? (I found that to have a major cpu
> > penalty when developing my custom widgets so I stopped using it
> in
> > my design.)
> >
> >
> >
> > -- David J. Andruczyk
> >
> >
> >
> >
>
____________________________________________________________________________________
> > Now that's room service!  Choose from over 150,000 hotels
> > in 45,000 destinations on Yahoo! Travel to find your fit.
> > http://farechase.yahoo.com/promo-generic-14795097
> > _______________________________________________
> > gtk-list mailing list
> > gtk-list gnome org
> > http://mail.gnome.org/mailman/listinfo/gtk-list
> >
> 
> This might be a shot in the dark, but have you tried disabling
> pango's
> markup processing with this function:
>
http://developer.gnome.org/doc/API/2.0/gtk/GtkLabel.html#gtk-label-set-use-markup
> 
> HTH,
> Paul
> 


-- David J. Andruczyk


 
____________________________________________________________________________________
Bored stiff? Loosen up... 
Download and play hundreds of games for free on Yahoo! Games.
http://games.yahoo.com/games/front



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