Re: [Linux-fbdev-devel] [PATCH 1/1 2.6.13] framebuffer: bit_putcs() optimization for 8x* fonts

From: Roman Zippel (zippel_at_linux-m68k.org)
Date: 08/30/05

  • Next message: Nathan Becker: "strange CPU speedups with SMP on Athlon 64 X2"
    Date:	Tue, 30 Aug 2005 21:13:43 +0200 (CEST)
    To: Knut Petersen <Knut_Petersen@t-online.de>
    
    
    

    Hi,

    On Tue, 30 Aug 2005, Knut Petersen wrote:

    > > Probably you can make it even faster by avoiding the multiplication, like
    > >
    > > unsigned int offset = 0;
    > > for (i = 0; i < image.height; i++) {
    > > dst[offset] = src[i];
    > > offset += pitch;
    > > }
    > >
    >
    > More than two decades ago I learned to avoid mul and imul. Use shifts, add and
    > lea instead,
    > that was the credo those days. The name of the game was CP/M 80/86, a86, d86
    > and ddt ;-)
    >
    > But letīs get serious again.
    >
    > Your proposed change of the patch results in a 21 ms performance decrease on
    > my system.
    > Yes, I do know that this is hard to believe. I tested a similar variation
    > before, and the results
    > were even worse.

    Could you try the patch below, for a few extra cycles you might want to
    make it an inline function.

    bye, Roman

    Index: linux-2.6/drivers/video/fbmem.c
    ===================================================================
    --- linux-2.6.orig/drivers/video/fbmem.c 2005-08-30 01:55:18.000000000 +0200
    +++ linux-2.6/drivers/video/fbmem.c 2005-08-30 21:10:25.705462837 +0200
    @@ -82,11 +82,11 @@ void fb_pad_aligned_buffer(u8 *dst, u32
     {
             int i, j;
     
    + d_pitch -= s_pitch;
             for (i = height; i--; ) {
                     /* s_pitch is a few bytes at the most, memcpy is suboptimal */
                     for (j = 0; j < s_pitch; j++)
    - dst[j] = src[j];
    - src += s_pitch;
    + *dst++ = *src++;
                     dst += d_pitch;
             }
     }
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/


  • Next message: Nathan Becker: "strange CPU speedups with SMP on Athlon 64 X2"

    Relevant Pages

    • Re: PCI Express support for 2.4 kernel
      ... case tabs were mixed into the patch, which causes funny effects. ... Whole thing is used where shifts would have worked. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • [PATCH 2/2] aes-586-asm: small optimizations
      ... optimize out lea 0,%ebp ... remove two stray insns ... Overall, patch does not add and does not modify any insns, ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: [parisc-linux] Re: [PATCH 3/9] mm: parisc pte atomicity
      ... using your own tmpalias area sounds much better than getting ... I've simply not wrapped my head around the races, ... it looks like we agree that my patch is necessary and valid as is; ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: keyboard - was: Re: Linux 2.6.0-test4
      ... >> I was able to get the key unstuck by switching back and forth between ... I rebuild my kernel including your patch; ... I'll get back to you once I verify that the problem doesn't occur ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: 2.6.0-test8/test9 io scheduler needs tuning?
      ... interactivity with regard to desktop use. ... Going to improve the time info output of the ddd loops to get better data and ... with the patch the hang reported earlier was not encountered again so ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)