From owner-freebsd-current@FreeBSD.ORG Thu Mar 31 23:46:32 2005 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4534C16A4CE for ; Thu, 31 Mar 2005 23:46:32 +0000 (GMT) Received: from lexi.siliconlandmark.com (lexi.siliconlandmark.com [209.69.98.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id DE9AA43D39 for ; Thu, 31 Mar 2005 23:46:31 +0000 (GMT) (envelope-from andy@siliconlandmark.com) Received: from lexi.siliconlandmark.com (localhost [127.0.0.1]) j2VNkRFY097556; Thu, 31 Mar 2005 18:46:27 -0500 (EST) (envelope-from andy@siliconlandmark.com) Received: from localhost (andy@localhost)j2VNkRcD097553; Thu, 31 Mar 2005 18:46:27 -0500 (EST) (envelope-from andy@siliconlandmark.com) X-Authentication-Warning: lexi.siliconlandmark.com: andy owned process doing -bs Date: Thu, 31 Mar 2005 18:46:27 -0500 (EST) From: Andre Guibert de Bruet To: Peter Jeremy In-Reply-To: <20050331112549.GI71384@cirb503493.alcatel.com.au> Message-ID: <20050331183010.X52981@lexi.siliconlandmark.com> References: <20050330083435.GI75546@obiwan.tataz.chchile.org> <20050330183145.GB24465@odin.ac.hmc.edu> <20050331112549.GI71384@cirb503493.alcatel.com.au> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Information: Please contact the ISP for more information X-SL-MailScanner: Found to be clean X-SL-SpamCheck: not spam, SpamAssassin (score=-2.54, required 6, autolearn=not spam, AWL 0.06, BAYES_00 -2.60) X-MailScanner-From: andy@siliconlandmark.com cc: freebsd-current@freebsd.org cc: Jeremie Le Hen Subject: Re: strcspn(3) complexity improvement X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Mar 2005 23:46:32 -0000 On Thu, 31 Mar 2005, Peter Jeremy wrote: > On Wed, 2005-Mar-30 10:31:45 -0800, Brooks Davis wrote: >> The real question I have is, how long does the string need to be before >> this is a win and how much does it hurt for typical string lengths? >> I've written code with strcspn that needed to perform well, but it was >> parsing 80-column punch card derived formats. > > I was thinking about this last night. The easy way is to generate random > "string" and "charset" arrays of varying length and time both strcspn() > variants - this gives you two two-dimensional surfaces showing timing > vs argument size. The difficulty is visualising the result and > deciding whether pairs of random strings are realistic. I would be tempted to use list traffic as the haystack and random words of differing lengths from the aspell dict for the needle. Andy | Andre Guibert de Bruet | Enterprise Software Consultant > | Silicon Landmark, LLC. | http://siliconlandmark.com/ >