Benchmarking

Does anyone have any programs for comparing the performance of SDL code
to native platform code? I wanted to do a comparison to see if writing
cross platform code noticably degrades the performance of the application
as compared to native code. I would assume OpenGL in SDL would loose
almost nothing in performance as opposed to native code, but I wanted to
check some of the other routines like the 2D routines. This is for a
research project I’m doing.

http://www.mongeese.org

Does anyone have any programs for comparing the performance of SDL code
to native platform code? I wanted to do a comparison to see if writing
cross platform code noticably degrades the performance of the application
as compared to native code. I would assume OpenGL in SDL would loose
almost nothing in performance as opposed to native code, but I wanted to
check some of the other routines like the 2D routines. This is for a
research project I’m doing.

I don’t know of any, most of this type of comparison I’ve done is taking
existing native code and porting it to SDL and then comparing the two.
On the same platform, speed seems to be comparable. For the most part,
SDL really does just set up the video mode and get out of the way.

See ya!
-Sam Lantinga, Lead Programmer, Loki Entertainment Software

Wed, 06 Dec 2000 Garrett Banuk wrote:

Does anyone have any programs for comparing the performance of SDL code
to native platform code? I wanted to do a comparison to see if writing
cross platform code noticably degrades the performance of the application
as compared to native code. I would assume OpenGL in SDL would loose
almost nothing in performance as opposed to native code, but I wanted to
check some of the other routines like the 2D routines. This is for a
research project I’m doing.

Well… What exactly do you want to benchmark?

As long as we’re dealing with stuff that’s done just one or a few times per
frame (such as full screen blits, pageflipping, raster sync,…), it shouldn’t
make any measurable difference how many layers of abstraction there is. The
performance depends on the underlying driver architecture, the drivers and the
hardware.

As to OpenGL, AFAIK, SDL doesn’t even wrap the actual rendering calls of
OpenGL, so it shouldn’t affect performance at all.

The 2D stuff is a bit different, though. Basically, there are two ways of
implementing 2D games (except for using OpenGL , Glide, Direct3D IM or similar);

1) Build a full software engine.

2) Build an engine on top of a 2D rendering API.

Simplifying things a little, the first case does not depend on (in this case)
SDL for performance, as SDL is only used for setting up the display, and some
form of VRAM access. The second case, on the contrary, directly depends on how
well the 2D API is implemented, which in turn can depend on underlying APIs,
drivers and hardware.

Now, unfortunately, things are not quite that simple in the first case; the
full software engine. You may see performance impact due to DMA from sysRAM
to VRAM not being available on all platforms - but then again, if you’re
benchmarking SDL, you can’t blame it for this, as it’s (AFAIK) a shortcoming
of all existing Linux driver architectures, and some others as well.

//David

…- M A I A -------------------------------------------------.
| Multimedia Application Integration Architecture |
| A Free/Open Source Plugin API for Professional Multimedia |
----------------------> http://www.linuxaudiodev.com/maia -' ..- David Olofson -------------------------------------------. | Audio Hacker - Open Source Advocate - Singer - Songwriter |--------------------------------------> david at linuxdj.com -’