Re: GtkTreeView - why so SLOW?



Dňa St, 2002-06-26 at 14:18, Olaf Frączyk napísal:
> On Wed, 2002-06-26 at 13:13, S. Eken wrote:
> > 
> > 
> > Hi Olaf,
> > as I already posted under the subjects "Strange behaviour of
> > scrollbars in GTK 2.0" and "GTK 2.0 5 times slower than 1.2" in
> > gtk-devel-list I experienced a dramatic decrease in performace and a
> > similar increase in CPU usage, BUT (!!!) the CPU time is eaten up by the X
> > server (which, in my case is on a different (slower) machine as the one
> > running the application).
> > 
> > It would very interesting to know if your application uses the 60% CPU
> > time or if it is also the X server. Er, that is if you ARE using a
> > system with X.
> Hi,
>  
> Yes I use X. Both application and X server are on the same machine.
> As I said it is Duron 1GHz, 256 MB RAM, test with no other load, with
> enough free memory - no swapping etc.
> 
> They are for the same application compiled with GTK 2.0.5.
> What is interesting, I told about 2-3 percent when scrolling CList.
> But it was for my another application compiled with gtk 1.2.
> But now I have rewritten the GTH 2.0 code using TreeView to CList, and
> it takes much more CPU also. So GTK 2.0 is slow for old widgets and new
> widgets.
> 
> So from my point of view:
> CList: 
> loads very fast on GTK 1.2 and 2.0. 
> Scrolling takes a few CPU with gtk 1.2 but a lot with gtk 2.0
> 
> TreeView:
> Loads very slow on GTK 2.0.
> Eats a lot of CPU when scrolling.
> 
> 
> Below are results.
> They are for the same application compiled with GTK 2.0.5.
> ------------------------------
> With TreeView:
> Scrolling up and down list.
> CPU:
> user: 60 %
> system: 8 %
> 
> Processes:
> X: 10 %
> application: 50 %
> 
> When loading list:
> CPU:
> user: 97%
> system: 2%
> 
> Processes:
> X: 0.1 - 3 %
> application: up to 99 %
> 
> ------------------------------
> With CList:
> Scrolling up and down list:
> 
> CPU:
> user: 60 %
> system: 8 %
> 
> Processes:
> X: 22 %
> application: 43 %
> 
> When loading list:
> 
> Not enough time to check with top :)
> Below 3% X and 3% application.
> ----------------------------------
> Gtk 1.2 CList
> Scrolling up and down list:
> 
> Processes:
> X: 9 %
> application: 4 %
> 
> When loading list:
> 
> Not enough time to check with top :)
> Below 3% X and 3% application.
> 
> Regards,
> 
> Olaf
> 
> 
> 

As far as I know the problem is caused by pango. I like pango but I must
admit that it's slow. Very slow. Even if this isn't visible under normal
circumstances (several widgets, etc.), things get slower and worse with
table widgets (CList, TreeView) since each cell with text has to be
rendered with pango. I can say that most of the CPU time is consumed by
making a pango-layout and rendering it afterwards. 

Not much to say until pango gets faster (hopefully). There is one
"half-"solution. You can write your own cell-renderer (for TreeView)
that uses the old deprecated locale-sensitive rendering functions. But
you definitely should allow user to select the original unicode renderer
on request!

Please don't flame me. I've used this technique succesfully and I don't
think there's anything bad on letting user decide between speed and full
unicode support. (If he can't have both at the same time...)

-matej




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