Complete.Org: Mailing Lists: Archives: freeciv-dev: March 2005:
[Freeciv-Dev] Re: Render speed test with imlib/xrender/sdl/pixbuf/ftwl
Home

[Freeciv-Dev] Re: Render speed test with imlib/xrender/sdl/pixbuf/ftwl

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Jason Dorje Short <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Cc: Freeciv-Dev <freeciv-dev@xxxxxxxxxxx>
Subject: [Freeciv-Dev] Re: Render speed test with imlib/xrender/sdl/pixbuf/ftwl
From: Raimar Falke <i-freeciv-lists@xxxxxxxxxxxxx>
Date: Tue, 22 Mar 2005 20:01:36 +0100

On Mon, Mar 21, 2005 at 04:24:54PM -0500, Jason Dorje Short wrote:
> Raimar Falke wrote:
> 
> >Also note that I can only say that ftwl is used correctly. Please
> >suggest any other improvements of the usage of the other libs.
> 
> Note that most (99%) of our graphics don't use alpha.  And with some 
> tilesets (speciallly designed for older computers or for gui-xaw) no 
> graphics use alpha.

> For graphics without alpha drawing is much faster.

$ ./render_bench tst_transparent1.png 
Setup...
*** ROUND 1 ***
Time: 0.429 sec for FTWL off-screen.
Time: 2.411 sec for SDL off-screen.
Time: 1.200 sec for Imlib2 off-screen.
Time: 1.125 sec for pixbuf off-screen.
Time: 2.117 sec for Xrender on-screen.
Time: 1.916 sec for Xrender off-screen.
finished
$ ./render_bench tst_transparent2.png 
Setup...
*** ROUND 1 ***
Time: 0.826 sec for FTWL off-screen.
Time: 3.690 sec for SDL off-screen.
Time: 1.186 sec for Imlib2 off-screen.
Time: 1.969 sec for pixbuf off-screen.
Time: 1.808 sec for Xrender on-screen.
Time: 2.146 sec for Xrender off-screen.
finished

The frist is the original picture with about 10-20% alpha pixels. The
second is 100% alpha.

So the answer is that it depends. imlib2 with mmx and xrender doesn't
care.
ftwl:   +95%
sdl:    +53%
pixbuf: +57%

BUT note that this is a dynamic change. ftwl, sdl and pixbuf know when
to do the expensive alpha multiplications and avoid them if they don't
have to. So if you reduce the alpha ratio you get faster blitting.

> For instance with gdk2 I measure drawing with pixmap+mask to be 4x 
> faster than drawing with pixbufs.  So the current method in the gtk2 
> client uses pixmap+mask for all sprites that don't use alpha, and pixbuf 
> for those that do.

That is another optimisation. But for picture which doesn't have alpha
(0<value<255) pixels the difference are very small (from 17 to 19
cycles per pixel for ftwl). It is just one more compare.

        Raimar

-- 
 email: i-freeciv-lists@xxxxxxxxxxxxx
  "Some development methodoligies suck. In fack, I think most of them
   do. The Linux kernel development is an unorganized mess. The
   OpenBSD kernel development is a closed mess. XFree86 development
   is a mysterious mess. And that's before we even get to proprietary
   software, which is often ten times worse"
    -- John Goerzen in freeciv-dev

Attachment: render_bench3.tar.gz
Description: application/tar-gz


[Prev in Thread] Current Thread [Next in Thread]