From owner-freebsd-arch@FreeBSD.ORG Tue Aug 2 17:20:44 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 B1E1516A41F; Tue, 2 Aug 2005 17:20:44 +0000 (GMT) (envelope-from obrien@NUXI.com) Received: from dragon.NUXI.org (trang.nuxi.com [66.93.134.19]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4472343D45; Tue, 2 Aug 2005 17:20:44 +0000 (GMT) (envelope-from obrien@NUXI.com) Received: from dragon.NUXI.org (obrien@localhost [127.0.0.1]) by dragon.NUXI.org (8.13.4/8.13.4) with ESMTP id j72HKgdZ085112; Tue, 2 Aug 2005 10:20:42 -0700 (PDT) (envelope-from obrien@dragon.NUXI.org) Received: (from obrien@localhost) by dragon.NUXI.org (8.13.4/8.13.1/Submit) id j72HKgmu085111; Tue, 2 Aug 2005 10:20:42 -0700 (PDT) (envelope-from obrien) Date: Tue, 2 Aug 2005 10:20:42 -0700 From: "David O'Brien" To: Xin LI Message-ID: <20050802172042.GA71672@dragon.NUXI.org> Mail-Followup-To: freebsd-arch@FreeBSD.org, freebsd-amd64@FreeBSD.org, Xin LI References: <20050801182518.GA85423@frontfree.net> <20050802013916.GA37135@dragon.NUXI.org> <20050802040246.GB3799@frontfree.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050802040246.GB3799@frontfree.net> X-Operating-System: FreeBSD 7.0-CURRENT Organization: The NUXI BSD Group X-Pgp-Rsa-Fingerprint: B7 4D 3E E9 11 39 5F A3 90 76 5D 69 58 D9 98 7A X-Pgp-Rsa-Keyid: 1024/34F9F9D5 User-Agent: Mutt/1.5.9i Cc: freebsd-amd64@FreeBSD.org, freebsd-arch@FreeBSD.org 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 Reply-To: freebsd-arch@FreeBSD.org, freebsd-amd64@FreeBSD.org 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:20:44 -0000 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 the > > > NetBSD assembly implementation of the string related operations. > > > > 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? 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 * 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 Just a few suggestions. It is easy to "optimize" for the simple input case 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. 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. 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. -- -- David (obrien@FreeBSD.org)