On Sun, Feb 24, 2008 at 10:42 AM, James Paige <[EMAIL PROTECTED]> wrote:
> On Sun, Feb 24, 2008 at 05:13:48AM +1300, Ralph Versteegen wrote:
>  > Top posting bonanza!
>  >
>  > >From what I gather, to get hardware accelerated scaling of bitmaps, it
>  > seems we would have to go all the way to OpenGL. But if we abstracted
>  > graphics sprites a bit more, it would probably still be much much
>  > faster to use SDL's (and fbgfx's?) software blitting.
>  >
>  > It should only take a couple minutes to improve the slow loops inside
>  > gfx_showpage and drawohr significantly (why hasn't anyone bothered?
>  > The comments even mention what's wrong). As for sprite_draw... well,
>  > amazingly
>  >       spix = (int((ty-syfrom) / scale) * .w) + int((tx-sxfrom) / scale)
>  > translates into only 43 instructions! And an example of the mess -exx 
> causes:
>  >       sptr[pix] = pal->col(.image[spix])
>  > also in the same inner loop, generates 3 calls to [EMAIL PROTECTED]
>  > and one to [EMAIL PROTECTED]
>
>  I'll take a shot at it (unless you are already)
>
>  When I compile with -profile, gprof tells me that 46% of the time is
>  spent in drawohr (25% when -exx is enabled)
>
>  ----------------------
>   %   cumulative   self              self     total
>   time   seconds   seconds    calls  ms/call  ms/call  name
>   46.12      1.07     1.07    56450     0.02     0.02  DRAWOHR
>   27.16      1.70     0.63    30768     0.02     0.02  GRABRECT
>   8.19      1.89     0.19      309     0.61     0.61  GFX_SHOWPAGE
>   4.74      2.00     0.11     1000     0.11     0.13  DRAWSPRITEX
>   3.02      2.07     0.07
>  blit8to32BGR_x_loop
>   1.72      2.11     0.04   255633     0.00     0.00  READBLOCK
>   1.72      2.15     0.04                             fb_DevFileRead
>   1.72      2.19     0.04                             fb_FileGetDataEx
>  [clipped]
>
>
>  ---
>  James Paige

Have you started? I can always take a stab after you.

  %   cumulative   self              self     total
 time   seconds   seconds    calls  ms/call  ms/call  name
 26.81     43.66    43.66                             DRAWOHR
(allmodex.bas:3247 @ 4317ff)
 19.46     75.34    31.69                             DRAWOHR
(allmodex.bas:3244 @ 4317a4)
 10.85     93.01    17.66                             GFX_SHOWPAGE
(gfx_fb.bas:79 @ 46a6ce)
  4.29    100.00     6.99                             GRABRECT
(allmodex.bas:3282 @ 43193b)
  4.12    106.71     6.71                             DRAWOHR
(allmodex.bas:3249 @ 431822)

Line-by-line profiling is encouraging: most of the top offenders are
unnecessary lines of code.
_______________________________________________
Ohrrpgce mailing list
[email protected]
http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org

Reply via email to