Subject: Re: lib/35535: memcpy() is very slow if not aligned
To: None <port-amd64-maintainer@netbsd.org, gnats-admin@netbsd.org,>
From: Kimura Fuyuki <fuyuki@hadaly.org>
List: netbsd-bugs
Date: 02/03/2007 10:30:02
The following reply was made to PR port-amd64/35535; it has been noted by GNATS.
From: Kimura Fuyuki <fuyuki@hadaly.org>
To: gnats-bugs@netbsd.org
Cc:
Subject: Re: lib/35535: memcpy() is very slow if not aligned
Date: Sat, 3 Feb 2007 19:29:17 +0900
Sorry for misfiling...
If you want further improvement, here's also an SSEd version which scales to
megs and preserves cached data.
http://www.hadaly.org/fuyuki/bcopy-sse.patch
plain:
$ time ./memcpy_bench 1000000 10000 0 0
dst:0x503000 src:0x5f8000 len:1000000
./memcpy_bench 1000000 10000 0 0 9.50s user 0.00s system 99% cpu 9.566 total
patched:
$ time ./memcpy_bench 1000000 10000 0 0
dst:0x503000 src:0x5f8000 len:1000000
./memcpy_bench 1000000 10000 0 0 6.38s user 0.00s system 99% cpu 6.425 total
xine's score:
Benchmarking memcpy methods (smaller is better):
libc memcpy() : 218605133
linux kernel memcpy() : 308372235
MMX optimized memcpy() : 312928386
MMXEXT optimized memcpy() : 216660195
SSE optimized memcpy() : 214245218