[AD] RLE clipping speedup patch

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


Title: RLE clipping speedup patch

This is, believe it or not, a sample profile of my game on the new
map which I'm making. Baffling eh ? :) I have a lot of large RLE
sprites which are clipped heavily. While I could also use BITMAPs
for these, there also have a fair amount of transparency in them,
so the RLE way has advantages too. So I added a lines pointer to
the RLE struct, so top and right clipping is in O(1) now (related
to the sprite's width). eg, it doesn't need to trace the sprite
data to find the next line.
get_rle_sprite is now a wrapper to get_rle_sprite_ex. You might
want to change the default to be leaving the lines pointer NULL
to behave exactly like the current Allegro, though it does not
waste much memory (unless you have very tall and very thing RLE
sprites only).
Please, someone add some as code to DO_RLE in src/i386/sprite.inc
as I only modified the C versions of the code. I tried wading
through it, but it's been years since I coded asm in anger, and
I keep using insns in the "usual" way (dest/src).


Flat profile:

Each sample counts as 0.01 seconds.
  %   cumulative   self              self     total
 time   seconds   seconds    calls  ms/call  ms/call  name
 37.32     66.78    66.78                             rle_lit_clip_top_loop
 15.32     94.20    27.42                             rle_lit_clip_skip_rgap
  7.17    107.03    12.83                             rle_clip_top_loop
  7.05    119.64    12.61 264627889     0.00     0.00  blender_light16(unsigned
long, unsigned long, unsigned long)
  6.14    130.62    10.98                             even_lmmx_loop
  5.00    139.57     8.96                             lit_rle_clipped_run_loop1
  3.62    146.04     6.47                             rle_clip_skip_rgap

--
Vincent Penquerc'h

 

Attachment: rle-lines.diff
Description: Binary data



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/