RLE Acceleration - "Real world" results

Hello,

Well, all the benchmarks are nice, but I wanted to see if the improved RLE
blitting code could cause a significant speed increase in the bottom line
frame rate for a “real-world” SDL application.

Using “Defendguin-0.0.2b” (http://www.newbreedsoftware.com/defendguin/) I
obtained a very significant speedup.

All I did was remove the comment from the “SHOW_FPS” #define on line 14
(to make it show the FPS on screen) and added SDL_RLEACCEL to the
SDL_SetColorKey flags on line 3622 (to enable RLE acceleration).

The results were as follows (on my dual Celeron 466):

Original non-RLE speed: approx. 10 FPS
Current SDL RLE speed: approx. 20 FPS
Xark RLE patch speed: approx. 26 FPS
Yorick RLE patch speed: aprrox. 27 FPS

Yorick’s (a.k.a. Mattias Engdegard) patch (posted here
a few days ago) doesn’t use “tokens” (RLE opcodes) so it eliminates a
"switch" statement in the inner loops, speeding things up a tad from mine
(which used Sam’s original encoding scheme).

I noticed no other differences in game play, other than the speedup (i.e.,
I don’t think the RLE “broke” anything).

Thats a pretty substantial speedup for just setting a single flag. 2-D SDL
game authors take note, SDL_RLEACCEL is your friend (especially with the
new patches). :slight_smile:

Take it easy,
Ken Jordan (aka Xark)

P.S. Kudos to New Breed Software and Bill Kendrick, this testing would
have been much faster if I hadn’t wasted so much time having fun playing
Defendguin. :slight_smile:

Using “Defendguin-0.0.2b” (http://www.newbreedsoftware.com/defendguin/) I
obtained a very significant speedup.

All I did was remove the comment from the “SHOW_FPS” #define on line 14
(to make it show the FPS on screen) and added SDL_RLEACCEL to the
SDL_SetColorKey flags on line 3622 (to enable RLE acceleration).

Heheheh :slight_smile:

The results were as follows (on my dual Celeron 466):

Original non-RLE speed: approx. 10 FPS
Current SDL RLE speed: approx. 20 FPS
Xark RLE patch speed: approx. 26 FPS
Yorick RLE patch speed: aprrox. 27 FPS

Cool! I haven’t been paying attention at all, honestly. Has Sam decided
to incorporate any of these patches into SDL yet?

(Yorick, can you resend your patch? :slight_smile: )

> P.S. Kudos to New Breed Software and Bill Kendrick, this testing would > have been much faster if I hadn't wasted so much time having fun playing > Defendguin. :)

Hehehehe :wink:

-bill!
(who really sucks at the arcade Defender… too many damned buttons!)

(Yorick, can you resend your patch? :slight_smile: )

Get it from ftp://ptah.lnf.kth.se/pub/misc/SDL_RLEaccel.c.gz (it’s the whole
file, not a patch)

(who really sucks at the arcade Defender… too many damned buttons!)

Try Stargate. Eugene Jarvis thought Defender was too easy so he made a more
challenging version with more buttons…

– Mattias (Yorick)

Whoops! My FPS numbers are bogus “real world” results. :slight_smile:

As Bill says, his “FPS” indicator wasn’t really frames per second, but
instead the number of milliseconds left after all work was done for each
33 ms. “game” frame (not including SDL_Flip() time).

So his game was always trying to run at aprrox 30 frame per second on my
machine, it just got its work done in approx. 5 ms with the RLE
accelerated blit, leaving about 27ms to “burn” vs taking around 20ms
without RLE and having to burn only 10ms (since blitting took longer).

I should have realized this, as the game seemed fairly fast in all cases,
but I reported the machines “objective” measurement. D’oh! :slight_smile:

Still, speed is a good thing, and the test does show a significant
blitting speed increase. On a slower machine than mine, the RLE
acceleration could mean the difference between achieveing the desired 30
frames per second or not.

I did a quick hack of his FPS indicator to make it show true frames per
second, and removed his SDL_Delay (to make the game run at an “all out
rip”).

Without RLE I get about 23-25 real FPS. **
With RLE using the latest patch I get 36-37 FPS.

YMMV.

Sorry about any confusion I may have caused. :slight_smile:

Take it easy,
Ken

** FPS is a bit less than expected from the older numbers because the
older “time remaining” number also didn’t include time taken up by
SDL_Flip(), which can be substantial.

The results were as follows (on my dual Celeron 466):

Original non-RLE speed: approx. 10 FPS
Current SDL RLE speed: approx. 20 FPS
Xark RLE patch speed: approx. 26 FPS
Yorick RLE patch speed: aprrox. 27 FPS

VERY nice. :slight_smile:

I’ll be including it in the latest CVS as soon as possible.

Thanks!
-Sam Lantinga, Lead Programmer, Loki Entertainment Software

Without RLE I get about 23-25 real FPS. **
With RLE using the latest patch I get 36-37 FPS.

I would be interested in seeing benchmarks with the original SDL_RLEACCEL
code and the new benchmark.

Also, try the testsprite example program - it provides benchmarks and
heavily uses the RLE acceleration feature.

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