Date: Wed, 3 Aug 2005 00:41:20 +0800 From: Xin LI <delphij@frontfree.net> To: freebsd-arch@FreeBSD.org, freebsd-amd64@FreeBSD.org Subject: Re: [RFC] Port of NetBSD's optimized amd64 string code Message-ID: <20050802164120.GA16775@frontfree.net> In-Reply-To: <20050802013916.GA37135@dragon.NUXI.org> References: <20050801182518.GA85423@frontfree.net> <20050802013916.GA37135@dragon.NUXI.org>
next in thread | previous in thread | raw e-mail | index | archive | help
--XF85m9dhOBO43t/C Content-Type: multipart/mixed; boundary="CE+1k2dSO48ffgeK" Content-Disposition: inline --CE+1k2dSO48ffgeK Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Aug 01, 2005 at 06:39:16PM -0700, David O'Brien wrote: > On Tue, Aug 02, 2005 at 02:25:18AM +0800, Xin LI wrote: > > Here is a patchset that I have produced to make our libc aware of the > > NetBSD assembly implementation of the string related operations. >=20 > What performance benchmarks have these been thru? In summary: index, rindex, memchr, strchr, strlen, strlen, strrchr are faster than their C counterparts; ffs, strncmp are about the same, and swab is worse. Note that these tests are done within loops that first copy a string to a new place, then perform the operation, then free the string, to defeat cache effects. The attachement has provided some details. If anyone wants the (ugly) test code, please let me know. Cheers, --=20 Xin LI <delphij frontfree net> http://www.delphij.net/ See complete headers for GPG key and other information. --CE+1k2dSO48ffgeK Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=result-x86_64vsC BETTER CASES [delphij@warrior7] ~/test/index> /usr/bin/time ./index 5.81 real 5.79 user 0.00 sys ASSEMBLY 1.84 real 1.82 user 0.00 sys [delphij@warrior7] ~/test/rindex> /usr/bin/time ./rindex 6.25 real 6.24 user 0.00 sys ASSEMBLY 2.17 real 1.84 user 0.01 sys [delphij@warrior7] ~/test/memchr> /usr/bin/time ./memchr 5.93 real 5.91 user 0.00 sys ASSEMBLY 1.91 real 1.84 user 0.00 sys [delphij@warrior7] ~/test/strchr> /usr/bin/time ./strchr 5.93 real 5.91 user 0.00 sys ASSEMBLY 1.84 real 1.83 user 0.00 sys [delphij@warrior7] ~/test/strlen> /usr/bin/time ./strlen 7.13 real 7.12 user 0.00 sys ASSEMBLY 1.44 real 1.43 user 0.00 sys [delphij@warrior7] ~/test/strrchr> /usr/bin/time ./strrchr 9.12 real 9.08 user 0.00 sys ASSEMBLY 4.71 real 4.69 user 0.00 sys WORSE/NO EFFECTS [delphij@warrior7] ~/test/ffs> /usr/bin/time ./ffs 0.33 real 0.33 user 0.00 sys ASSEMBLY 0.33 real 0.33 user 0.00 sys [delphij@warrior7] ~/test/strncmp> /usr/bin/time ./strncmp 3.90 real 3.88 user 0.00 sys 3.88 real 3.87 user 0.00 sys ASSEMBLY 3.88 real 3.87 user 0.00 sys [delphij@warrior7] ~/test/swab> /usr/bin/time ./swab 6.59 real 6.53 user 0.01 sys ASSEMBLY 8.06 real 8.05 user 0.00 sys --CE+1k2dSO48ffgeK-- --XF85m9dhOBO43t/C Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (FreeBSD) iD8DBQFC76Iw/cVsHxFZiIoRAm7dAJ9c9OXtEXP50o7LGwQu4LeehGzK2QCfa41T kNaVpPLdVEsHuZwlXoufgjY= =no2E -----END PGP SIGNATURE----- --XF85m9dhOBO43t/C--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050802164120.GA16775>