[cairo-bugs] [Bug 16128] New: optimize swap functions/speed improvement possible

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Wed May 28 08:32:45 PDT 2008


http://bugs.freedesktop.org/show_bug.cgi?id=16128

           Summary: optimize swap functions/speed improvement possible
           Product: cairo
           Version: 1.6.4
          Platform: All
        OS/Version: All
            Status: RESOLVED
          Severity: enhancement
          Priority: medium
         Component: xlib backend
        AssignedTo: cworth at cworth.org
        ReportedBy: charlet at adacore.com
         QAContact: cairo-bugs at cairographics.org



Behdad Esfahbod <freedesktop at behdad.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


In cairo-xlib-surface.c, it should be possible to get a 2x to 4x speed
improvement
for _swap_ximage_[24]bytes by using facilities provided in <byteswap.h> (under
glibc systems), or by using recent GCC's builtin __builtin_bswap32.

Arno


--- Comment #1 from Arnaud Charlet <charlet at adacore.com>  2008-05-28 02:06:37 PST ---
Created an attachment (id=16783)
 --> (http://bugs.freedesktop.org/attachment.cgi?id=16783)
test program with various byteswap implementations

The test program itself is too simple minded, but this attachment shows
several possible implementations of byteswapping which can be of interest.

$ gcc -O2 byteswap.c -o byteswap
$ ./byteswap 
UINT32_GCC_SWAP
time spent: 1114
cairo code
time spent: 2247
UINT32_SWAP
time spent: 2225
UINT32_GLIBC_SWAP
time spent: 747


--- Comment #2 from Behdad Esfahbod <freedesktop at behdad.org>  2008-05-28 08:32:43 PST ---
commit 5de0650dbbed7a44789f25b0a5226593931a8ce8
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Wed May 28 10:43:47 2008 -0400

    [cairo-xlib] Add recently-added byteswap macros (#16128)

commit dd8f3a5690e92ac3421e5bbc475cc3e78865d8ef
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Wed May 28 10:43:22 2008 -0400

    Add support for byteswap macros bswap_16 and bswap_32


-- 
Configure bugmail: http://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.


More information about the cairo-bugs mailing list