From owner-freebsd-arch@FreeBSD.ORG Tue Aug 2 16:41:37 2005 Return-Path: X-Original-To: freebsd-arch@FreeBSD.org Delivered-To: freebsd-arch@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6875416A41F; Tue, 2 Aug 2005 16:41:37 +0000 (GMT) (envelope-from delphij@frontfree.net) Received: from tarsier.geekcn.org (tarsier.geekcn.org [210.51.165.229]) by mx1.FreeBSD.org (Postfix) with ESMTP id B855243D45; Tue, 2 Aug 2005 16:41:36 +0000 (GMT) (envelope-from delphij@frontfree.net) Received: from beastie.frontfree.net (unknown [219.239.99.7]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by tarsier.geekcn.org (Postfix) with ESMTP id 14CA8EB4B16; Wed, 3 Aug 2005 00:41:33 +0800 (CST) Received: from localhost (localhost.frontfree.net [127.0.0.1]) by beastie.frontfree.net (Postfix) with ESMTP id 1CD2C1384F6; Wed, 3 Aug 2005 00:41:30 +0800 (CST) Received: from beastie.frontfree.net ([127.0.0.1]) by localhost (beastie.frontfree.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 16558-08; Wed, 3 Aug 2005 00:41:21 +0800 (CST) Received: by beastie.frontfree.net (Postfix, from userid 1001) id 6AD8F1384E5; Wed, 3 Aug 2005 00:41:20 +0800 (CST) Date: Wed, 3 Aug 2005 00:41:20 +0800 From: Xin LI To: freebsd-arch@FreeBSD.org, freebsd-amd64@FreeBSD.org Message-ID: <20050802164120.GA16775@frontfree.net> References: <20050801182518.GA85423@frontfree.net> <20050802013916.GA37135@dragon.NUXI.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="XF85m9dhOBO43t/C" Content-Disposition: inline In-Reply-To: <20050802013916.GA37135@dragon.NUXI.org> User-Agent: Mutt/1.4.2.1i X-GPG-key-ID/Fingerprint: 0xCAEEB8C0 / 43B8 B703 B8DD 0231 B333 DC28 39FB 93A0 CAEE B8C0 X-GPG-Public-Key: http://www.delphij.net/delphij.asc X-Operating-System: FreeBSD beastie.frontfree.net 5.4-RELEASE-p6 FreeBSD 5.4-RELEASE-p6 #4: Thu Jul 28 10:59:26 CST 2005 delphij@beastie.frontfree.net:/usr/obj/usr/src/sys/BEASTIE i386 X-URL: http://www.delphij.net X-By: delphij@beastie.frontfree.net X-Location: Beijing, China X-Virus-Scanned: amavisd-new at frontfree.net Cc: Subject: Re: [RFC] Port of NetBSD's optimized amd64 string code X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Aug 2005 16:41:37 -0000 --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 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--