From owner-freebsd-arch@FreeBSD.ORG Tue Aug 2 17:36:07 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 B271716A429; Tue, 2 Aug 2005 17:36:07 +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 D53B043D48; Tue, 2 Aug 2005 17:36:06 +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 A7F73EB3FCC; Wed, 3 Aug 2005 01:36:04 +0800 (CST) Received: from localhost (localhost.frontfree.net [127.0.0.1]) by beastie.frontfree.net (Postfix) with ESMTP id 65EF113435F; Wed, 3 Aug 2005 01:36:01 +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 17150-14; Wed, 3 Aug 2005 01:35:53 +0800 (CST) Received: by beastie.frontfree.net (Postfix, from userid 1001) id 63E31133D09; Wed, 3 Aug 2005 01:35:52 +0800 (CST) Date: Wed, 3 Aug 2005 01:35:52 +0800 From: Xin LI To: freebsd-arch@FreeBSD.org, freebsd-amd64@FreeBSD.org Message-ID: <20050802173552.GB17471@frontfree.net> References: <20050801182518.GA85423@frontfree.net> <20050802013916.GA37135@dragon.NUXI.org> <20050802040246.GB3799@frontfree.net> <20050802172042.GA71672@dragon.NUXI.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="/WwmFnJnmDyWGHa4" Content-Disposition: inline In-Reply-To: <20050802172042.GA71672@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 17:36:07 -0000 --/WwmFnJnmDyWGHa4 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Aug 02, 2005 at 10:20:42AM -0700, David O'Brien wrote: > On Tue, Aug 02, 2005 at 12:02:46PM +0800, Xin LI wrote: > > 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 t= he > > > > NetBSD assembly implementation of the string related operations. > > >=20 > > > What performance benchmarks have these been thru? > .. > > BTW. Would you please give me some hints on the benchmarking? I am > > not sure whether just looping the test cases on some determine dataset > > would be enough? >=20 > Try some real world tests such as 'make buildworld'. Looking in > src/usr.bin the following utils make good use of these libc functions and > would be good real world tests: uuencode catman compress last makewhatis >=20 > * uuencode a large kernel > * run /etc/periodic/weekly/320.whatis > * compress a large kernel > * last delphij on a large /var/log/wtmp > * cp /usr/src/share/man/man[1-9] to a ram disk and then run catman over it Thanks, I will try these tomorrow. > Just a few suggestions. It is easy to "optimize" for the simple input ca= se > and miss the larger case. I've also seen people "optimize" for all cases > but then wind up with so much overhead that small inputs are slower. >=20 > I have some very fancy routines from AMD that take into account cache > size, alignment, and uses the prefetch instructions. The problem is they > are a huge win for large input sizes, but I'm concerned about their > performance on small input sizes. >=20 > If these NetBSD routines perform better in the tests I listed above, we > should commit them. We can continue to refine these libc routines over > time. Agreed. I will do more careful benchmarks that can reflect more real world= =20 better, to figure out whether these "optimizations" are really necessary for us. Cheers, --=20 Xin LI http://www.delphij.net/ See complete headers for GPG key and other information. --/WwmFnJnmDyWGHa4 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (FreeBSD) iD8DBQFC7674/cVsHxFZiIoRAu/4AJ9w62vonIN+p9sfcdZZNJcuOkSsHgCcDpci 5psIn9+yVcxR0DVnB248410= =beKZ -----END PGP SIGNATURE----- --/WwmFnJnmDyWGHa4--