[Xcb] Basic test of Qt5 toolkit performance, XCB versus native, XLIB (XCB wins)

Samuel Rødal samuel.rodal at digia.com
Tue Dec 11 01:17:34 PST 2012


On 12/10/2012 10:39 PM, ext Rick Stockton wrote:
> Samuel,
>
> My test program was the "moveblocks" Example (widget-based). I simply
> increased the size of the Window, the size of the Blocks, and the moving
> speed, and I sent some QDebug 'total moves done' and 'elapsed time'
> statistics to the console, while watching "top". Do you want to use this
> simplistic test, even though YOU can probably come up with something
> MUCH BETTER in about 5 minutes of time?

Well, it's always easy to create synthetic benchmarks that gain greatly 
from some optimization, but the real world benefit can be harder to 
judge. Looking at the moveblocks example I guess it can be classified as 
more or less synthetic too. In any case, point taken :)

Btw, when I do benchmarking of Qt I typically insert this code snippet 
and call frameRendered() from the paintEvent():

static void frameRendered()
{
     static int frameCount = 0;
     static QTime lastTime = QTime::currentTime();

     ++frameCount;

     const QTime currentTime = QTime::currentTime();

     const int interval = 2500;

     const int delta = lastTime.msecsTo(currentTime);

     if (delta > interval) {
         qreal fps = 1000.0 * frameCount / delta;
         qDebug() << "FPS:" << fps;

         frameCount = 0;
         lastTime = currentTime;
     }
}

--
Samuel


More information about the Xcb mailing list