From owner-cvs-src@FreeBSD.ORG Sat Apr 2 18:59:44 2005 Return-Path: Delivered-To: cvs-src@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6C61416A4CE for ; Sat, 2 Apr 2005 18:59:44 +0000 (GMT) Received: from hydra.bec.de (www.ostsee-abc.de [62.206.222.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1B84A43D46 for ; Sat, 2 Apr 2005 18:59:44 +0000 (GMT) (envelope-from joerg@britannica.bec.de) Received: from britannica.bec.de (wlan033219.uni-rostock.de [139.30.33.219]) by hydra.bec.de (Postfix) with ESMTP id 0685A35707 for ; Sat, 2 Apr 2005 20:59:43 +0200 (CEST) Received: by britannica.bec.de (Postfix, from userid 1001) id 70B1B7CF8; Sat, 2 Apr 2005 20:57:27 +0200 (CEST) Date: Sat, 2 Apr 2005 20:57:27 +0200 From: Joerg Sonnenberger To: cvs-src@freebsd.org Message-ID: <20050402185727.GA91669@britannica.bec.de> References: <200504021852.j32IqjhR031587@repoman.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200504021852.j32IqjhR031587@repoman.freebsd.org> User-Agent: Mutt/1.5.9i Subject: Re: cvs commit: src/lib/libc/string strcspn.c strspn.c src/sys/libkern strspn.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Apr 2005 18:59:44 -0000 On Sat, Apr 02, 2005 at 06:52:45PM +0000, David Schultz wrote: > Replace the current strspn() and strcspn() with significantly faster > implementations inspired by the ones in DragonFly. Unlike the > DragonFly versions, these have a small data cache footprint, and my > tests show that they're never slower than the old code except when the > charset or the span is 0 or 1 characters. This implementation is > generally faster than DragonFly until either the charset or the span > gets in the ballpark of 32 to 64 characters. The trade off is between bzero(256) and an additional bit operation per input and charset byte. I was thinking about doing it with bit-ops, but I haven't had the time for actual benchmarks so I choose the simpler version. Joerg