I have done some more rigorous benchmarking to better understand the
graphics performance differences between OSX and Windows, and according
to various methods.
I have tested drawing using the raster engine or the native engine
(on windows, it's the same), and drawing directly or indirectly
via a QImage or QPixmap. This for both OSX and Windows.
Figures follow.
Tested with Qt 4.6 beta 1, on a quad-core i7 2.66 GHz (Mac Pro)
with either OSX 10.5 or Windows 7
Time in milliseconds (smaller is better).
A surface of about 2 millions pixels is painted, simple stuff,
consisting of a gradient background, about 4000 lines, a bit of text.
No anti-aliasing.
Of course the figures could be very different with another graphics contents.
Engine QImage QPixmap OSX Windows
===========================================================
native 42 14
native yes 28 15
native yes 44 15
raster 30 14
raster yes 33 15
raster yes 34 15
What these figures show mainly is:
* Drawing under Windows is between 2 and 3 times faster (!).
* Raster engine is preferred on the mac, unless one draws
into a QImage, which is then the best solution.
I hope I can test soon on snow leopard to see if there is an improvement.
The QImage speed suggests that drawing performance on OSX could be sensibly
improved
by using a better compiler. In Digital Signal Processing,
it is not unusual to see a +100% speed improvement by using the intel compiler
in certain parts,
though this is never something systematic. This compiler is good but very slow
to compile.
Maybe the Qt drawing primitives could be isolated and compiled separatly using
such compiler...
Philippe
On Wed, 21 Oct 2009 09:29:42 +0200
Gunnar Sletta <[email protected]> wrote:
> Philippe wrote:
> > I run in release, yes.
> >
> > What is strange to me is this:
> >
> > One of my main and large widget draws thousands of lines (no
> > antialisaing), a gradient background, a bit of to text, to display data
> > changing in real time (hence the importance of speed).
> >
> > I need to maintain a cache hence I draw into a QImage. I choose a QImage
> > because it is faster than drawing into a QPixmap, at least for the
> > graphics I do, as I could test it.
> >
> > Now, if I do:
> >
> > QApplication::setGraphicsSystem("raster");
> >
> > then my widget display is much slower than if I do nothing (eg. "native").
> > I don't understand this, as drawing into a QImage is "raster" (as far as
> > I understand). So I don't know why there is any difference of speed at
> > all.
>
> Are you still drawing to a temporary QImage in the raster case?
>
> Is drawing directly to a QImage followed by QPainter::drawImage() faster
> than graphicssystem raster and drawing directly to QPainter?
>
>
> > And as far as I remember, there was not this difference with 4.5.0.
> > However, I don't have 4.5.x installed anymore to confirm today.
> >
> > BTW, one thing I don't understand, is that drawing so in a QImage is
> > much faster under Windows than Mac (same machine). I know the difference
> > of quality between VC++ and GCC, but the speed difference is large
> > enough not to rely on this sole explanation, IMHO.
> > Maybe the time needed to render a QImage onto screen is different
> > between the two platforms?...
>
> GCC is a lot worse than VC++, I've observed VC being up to 3x faster in
> tight loops based for the same code in extreme cases, but the difference
> doesn't bubble up to application level... Possibly a +/-10% difference.
>
> Could it be that you are not getting SSE/MMX instructions on Mac? Are
> you on 10.4 by any chance?
_______________________________________________
Qt4-preview-feedback mailing list
[email protected]
http://lists.trolltech.com/mailman/listinfo/qt4-preview-feedback