Re: --gtk-unbuffered



Hans Breuer <hans breuer org> writes:

I'll respond in some more detail later, but to make two quick points

 - I hope you don't get the impression that I don't care about
   performance, or that I don't appreciate you trying to 
   fix what is going wrong. I just have the feeling that
   you may be looking in the wrong places.

 - Your timings are extrodinarily higher than what we see on
   X11; this indicates that the problem lies, not in what
   GtkLabel is doing, but most likely in the backend Win32
   is using for Pango.

> gtk_label_ensure_layout: L - 25x13 0.000000
> gtk_label_ensure_layout: - - 15x13 0.000000
> gtk_label_ensure_layout: - W 278x52 0.512000
> gtk_label_ensure_layout: L - 15x13 0.000000
> gtk_label_ensure_layout: L - 15x13 0.000000
> gtk_label_ensure_layout: L W 278x52 0.515000
> gtk_label_ensure_layout: - - 26x15 0.000000
> gtk_label_ensure_layout: - W 278x52 0.485000
> gtk_label_ensure_layout: L - 26x15 0.000000
> gtk_label_ensure_layout: L - 26x15 0.000000
> gtk_label_ensure_layout: L W 278x52 0.510000
> gtk_label_ensure_layout: - - 15x13 0.000000
> gtk_label_ensure_layout: - - 33x13 0.004000
> gtk_label_ensure_layout: - W 278x52 0.495000
> gtk_label_ensure_layout: L - 15x13 0.000000
> gtk_label_ensure_layout: L - 33x13 0.000000
> gtk_label_ensure_layout: L - 15x13 0.000000
> gtk_label_ensure_layout: L - 33x13 0.000000
> gtk_label_ensure_layout: L W 278x52 0.465000
> gtk_label_ensure_layout: - - 18x15 0.000000
> gtk_label_ensure_layout: - - 14x15 0.005000
> gtk_label_ensure_layout: - W 278x52 0.485000
> gtk_label_ensure_layout: L - 18x15 0.005000
> gtk_label_ensure_layout: L - 14x15 0.000000
> gtk_label_ensure_layout: L - 18x15 0.000000
> gtk_label_ensure_layout: L - 14x15 0.000000
> gtk_label_ensure_layout: L W 278x52 0.456000

And on X11: (400mhz Celeron, so we'd expect something
like twice as fast as the above timings.)

gtk_label_ensure_layout: L - 126x15 0.000039
gtk_label_ensure_layout: - - 28x21 0.000382
gtk_label_ensure_layout: - W 477x84 0.008616
gtk_label_ensure_layout: L - 28x21 0.000024
gtk_label_ensure_layout: L - 28x21 0.000027
gtk_label_ensure_layout: L W 477x84 0.008723
gtk_label_ensure_layout: - - 48x21 0.000422
gtk_label_ensure_layout: - W 477x84 0.008681
gtk_label_ensure_layout: L - 48x21 0.000029
gtk_label_ensure_layout: L - 48x21 0.000031
gtk_label_ensure_layout: L W 477x84 0.008664
gtk_label_ensure_layout: - - 28x21 0.000351
gtk_label_ensure_layout: - - 57x21 0.000330
gtk_label_ensure_layout: - W 477x84 0.008653
gtk_label_ensure_layout: L - 28x21 0.000024
gtk_label_ensure_layout: L - 57x21 0.000018
gtk_label_ensure_layout: L - 28x21 0.000028
gtk_label_ensure_layout: L - 57x21 0.000035
gtk_label_ensure_layout: L W 477x84 0.008644
gtk_label_ensure_layout: - - 33x21 0.000468
gtk_label_ensure_layout: - - 24x21 0.000439
gtk_label_ensure_layout: - W 477x84 0.008750
gtk_label_ensure_layout: L - 33x21 0.000034
gtk_label_ensure_layout: L - 24x21 0.000032
gtk_label_ensure_layout: L - 33x21 0.000035
gtk_label_ensure_layout: L - 24x21 0.000032
gtk_label_ensure_layout: L W 477x84 0.008861

And we see that X11 is actually 50 times as fast...

> Here's the timing for testgtk::labels
> ...
> gtk_label_ensure_layout: - W 297x91 0.860000
> gtk_label_ensure_layout: - - 96x13 0.005000
> gtk_label_ensure_layout: - W 297x91 0.775000
> gtk_label_ensure_layout: - - 76x13 0.005000
> gtk_label_ensure_layout: - - 224x30 0.050000
> gtk_label_ensure_layout: - - 61x13 0.005000
> ...

gtk_label_ensure_layout: - W 519x147 0.015140
gtk_label_ensure_layout: - - 169x21 0.000457
gtk_label_ensure_layout: - W 518x147 0.014140
gtk_label_ensure_layout: - - 132x21 0.000420
gtk_label_ensure_layout: - - 470x43 0.001602

Again 50-60 times as fast.

> >GtkLabel uses a quite inefficient algorithm for figuring out the
> >requested size, which involves repeatedly re-laying out the
> >text at different widths.
> >
> >But, it's not worth trying to fix this algorithm unless it actually
> >produces _noticeably_ bad performance, especially since a fix
> >would involve considerable increases in complexity.
> > 
> >From what timing needs do you think it is _noticeably_ bad performance ?
> Is half a second for a simple four line text acceptable ? 
> (I don't think so - otherwise I wouldn't have done the investigation at
> all. And there are other things I would like to spend my time on, e.g. Dia
> improvements. Finally I'm doing this in my spare time and get payed for
> developing on a closed source high performance real-time imaging system.)
 
I'm just trying to save you time by pointing out that GtkLabel's
algorithm isn't really the problem here. Of course, if you could speed
that up, I'd be delighted, since that would help X11 as well. 
But say you managed to speed it up 5 times - you would still be
taking 0.1 seconds, and still be 5 as slow as X11 was to start with.

Regards,
                                        Owen




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