Performance improvement shown by x11perf not reflected in GtkPerf

prudhvi raj prudhviraj.v at gmail.com
Thu Dec 3 08:13:22 PST 2009


>>Because x11perf and gtkperf exercise different code in the X
>>server,obviously.

yes, they both do not run same kind of test cases. But, isn't gtkperf
running on an accelerated server should give better results than that on an
accelerated server??

To know the exact reason, i have made a small Gtk application which draws a
fillrect 100 times using gdk_draw_rectangle() call.
I have checked the implementation of function used by gdk to draw a
rectangle - gdk_x11_draw_rectangle() function which internally calls
XFillRectangle/XDrawRectangle(). The same XFillRectangles() (though not
excatly same as XFillRectangle() its almost same) function is called by
x11perf to execute -rect500 test case.

Even though both of these (gdk_draw_rectangle() and x11perf -rect500) calls
XFillRectangle/XFillRectangles() internally why is the improvement is shown
only in x11perf case?? Is gdk is causing some overhead??

i am including the function of gtk application that i have used below:

static void
test_gtk_drawrects ( void )
{
    GtkWidget *window = gtk_test_create_simple_window ( "Test Window",
"Test: gtk_draw_rectangle" );
    GtkWidget *darea = gtk_drawing_area_new ();
    GTimer *gtimer = g_timer_new();
    gint repeat = 5;
    gtk_widget_set_size_request ( darea, 500, 500 );
    gtk_container_add ( GTK_CONTAINER ( GTK_BIN ( window )->child ), darea
);
    gtk_widget_show ( darea );
    gtk_widget_show_now ( window );
    while ( repeat-- )
    {
        gint i, many = 100;
        double elapsed_time;
        while ( gtk_events_pending () )
            gtk_main_iteration ();
        /* run a number of consecutive drawing requests, just using drawing
queue */
        g_timer_start ( gtimer );
        for ( i = 0; i < many; i++ )
        {
            gdk_draw_rectangle ( darea->window, darea->style->black_gc,
TRUE, 0, 0, 500, 500 );
        }
        g_timer_stop ( gtimer );
        elapsed_time = g_timer_elapsed ( gtimer, NULL );
        printf("\nGtkDrawRectangle Time - %lf\n", elapsed_time);
        gdk_flush();
        while ( gtk_events_pending () )
            gtk_main_iteration ();
    }
    g_timer_destroy ( gtimer );
    sleep(3);
    gtk_widget_destroy ( window );
}

On Thu, Dec 3, 2009 at 9:08 PM, Vincent Torri <vtorri at univ-evry.fr> wrote:

>
>
> On Thu, 3 Dec 2009, Arnaud Mouiche wrote:
>
>  I think gtkperf is more a tool to test gtk non-regression or optimization
>> (on a same X server), than a tool to test X.
>>
>> I tried to use it to see if EXA optimizations that optimize everything by
>> doing nothing (screen stay black), makes Gtkperf more efficient.
>> the result was that xorg without EXA management overhead (so without any
>> optmization) gives better results than xorg with a EXA optimization that
>> can't be more efficient...
>>
>> Indeed, gtkperf ony creat pixmap, but doesn't try to move / blit /
>> compose... all the thing a acceleration can be used for.
>>
>> so what you need is a perf tool more usefull that measure the user
>> experience feeling (scrolling, transparency, move, composition).
>>
>> Does somebody know one ? I'm also interested.
>>
>
> you can try render_bench, written by Carsten Haitzler:
>
> http://www.rasterman.com/files/render_bench.tar.gz
>
> it mesures some operations, maybe not all you want though.
>
> Vincent Torri
>
>
>  arnaud
>>
>> Alan Coopersmith wrote:
>>
>>> prudhvi raj wrote:
>>>
>>>  My question is why is the performance improvement shown through x11perf
>>>> is not getting reflected when we run gtkperf??
>>>>
>>>>
>>> x11perf is a wonderful way to make you optimize code that no one ever
>>> calls.
>>>
>>> Notice that all the x11perf tests are single color, and use the Xlib
>>> drawing
>>> routines, while gtk is multicolor and usually does not use Xlib drawing.
>>>
>>>
>>>
>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.x.org/archives/xorg-devel/attachments/20091203/ef9051f3/attachment.html 


More information about the xorg-devel mailing list