Re: testgtk bench facility



Hans Breuer <hans breuer org> writes:

> IMHO one of the main issues of gtk+2.0 compared to the gtk-1.2
> and early gtk-1.3 series is performance. This is where I see
> adding a simple benchmark facility become handy.
> 
> The following patch does provide the ability to benchmark
> the construction of single widgets by simply passing there
> buttons name on the command line, like:
> 
> testgtk bench:labels <n>
> 
> (the optional n does allow to produce the average timing of
> multiple calls.)
> 
> It then calls the respective function, 'waits' with gdk_flush()
> and calls the function again (which almost always destroys the
> widget). The timing is g_print than and testgtk exits. The above
> examples produces the following output:
> 
> "labels" took   2700.0 ms
> 
> Objections against adding this facility ?

I like it. I've taken your patch, made some modifications:

 - Change invocation to testgtk --bench=labels:5
 - Run all tests with  testgtk --bench=all:5
 - Mark some functions in the buttons[] array as 
   "not for benchmarking" to make 'all' work better.
 - Separate out the first iteration in the reported results
   from the subsequent iterations, since they can be quite
   different and shouldn't be averaged.
 - Align output in colums

And checked it in. Feel free to tweak further. To get 
decent numbers under X, you need to run it without
a window manager.

./testgtk --bench=labels:5 

gives me, on a celeron 400, for the X backend:

Test                 Iters      First      Other
-------------------- ----- ---------- ----------
labels                   5      877.8      176.9

And for the Xft backend:

Test                 Iters      First      Other
-------------------- ----- ---------- ----------
labels                   5      568.8      279.6

Regards,
                                        Owen 




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