From owner-freebsd-arch@FreeBSD.ORG Wed Jul 11 20:24:19 2007 Return-Path: X-Original-To: freebsd-arch@FreeBSD.org Delivered-To: freebsd-arch@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9346A16A468 for ; Wed, 11 Jul 2007 20:24:19 +0000 (UTC) (envelope-from scf@FreeBSD.org) Received: from mail.farley.org (farley.org [67.64.95.201]) by mx1.freebsd.org (Postfix) with ESMTP id 59B4D13C46E for ; Wed, 11 Jul 2007 20:24:19 +0000 (UTC) (envelope-from scf@FreeBSD.org) Received: from thor.farley.org (thor.farley.org [192.168.1.5]) by mail.farley.org (8.14.1/8.14.1) with ESMTP id l6BKQ9SY007696 for ; Wed, 11 Jul 2007 15:26:09 -0500 (CDT) (envelope-from scf@FreeBSD.org) Date: Wed, 11 Jul 2007 15:24:01 -0500 (CDT) From: "Sean C. Farley" To: freebsd-arch@FreeBSD.org Message-ID: <20070711134721.D2385@thor.farley.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Spam-Status: No, score=-4.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.1 X-Spam-Checker-Version: SpamAssassin 3.2.1 (2007-05-02) on mail.farley.org Cc: Subject: Assembly string functions in i386 libc 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: Wed, 11 Jul 2007 20:24:19 -0000 While looking at increasing the speed of strlen(), I noticed that on i386 platforms (PIII, P4 and Athlon XP) the performance is abysmal in libc compared to the version I was writing. After more testing, I found it was only the assembly version that is really slow. The C version is fairly quick. Is there a need to continue to use the assembly versions of string functions on i386? Does it mainly help slower systems such as those with i386 or i486 CPU's? I have the results from my P4 (Id = 0xf24 Stepping = 4) system and the test program here[1]. strlen.tar.bz2 is the archive of it for anyone's testing. In the strlen/results subdirectory, there are the results for strings of increasing lengths. I would appreciate it if anyone could see if strlen and strlen2 perform any better on an amd64. Although the current C version of strlen() in 7-CURRENT is faster than mine for smaller values, they perform better for larger strings. I doubt people would want either of my versions in CURRENT just before the freeze :), but it would be nice to use the C version we do have instead of the assembly version. I cannot speak about the other string functions as I have not tested them. Sean 1. http://www.farley.org/freebsd/tmp/ -- scf@FreeBSD.org