From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19550 invoked by alias); 28 Aug 2005 23:32:10 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 19524 invoked by uid 22791); 28 Aug 2005 23:32:04 -0000 Received: from mail-out1.fuse.net (HELO smtp1.fuse.net) (216.68.8.174) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Sun, 28 Aug 2005 23:32:04 +0000 Received: from gx5.fuse.net ([216.196.213.211]) by smtp1.fuse.net (InterMail vM.6.01.04.04 201-2131-118-104-20050224) with ESMTP id <20050828233203.SMEL26845.smtp1.fuse.net@gx5.fuse.net>; Sun, 28 Aug 2005 19:32:03 -0400 Received: from dellpi.pinski.fam ([216.196.213.211]) by gx5.fuse.net (InterMail vG.1.02.00.02 201-2136-104-102-20041210) with ESMTP id <20050828233202.NFGF22043.gx5.fuse.net@dellpi.pinski.fam>; Sun, 28 Aug 2005 19:32:02 -0400 Received: from [10.0.0.80] (zhivago.i.pinski.fam [10.0.0.80]) by dellpi.pinski.fam (8.12.2/8.12.1) with ESMTP id j7SNVwDk024871; Sun, 28 Aug 2005 19:31:59 -0400 (EDT) In-Reply-To: <20050828232529.13202.qmail@sourceware.org> References: <20050820162349.23495.greenrd@greenrd.org> <20050828232529.13202.qmail@sourceware.org> Mime-Version: 1.0 (Apple Message framework v622) Content-Type: text/plain; charset=US-ASCII; format=flowed Message-Id: <5cfaf99323adafebaed2d40c31e257c6@physics.uc.edu> Content-Transfer-Encoding: 7bit Cc: gcc-bugs@gcc.gnu.org From: Andrew Pinski Subject: Re: [Bug libgcj/23495] java.lang.String.equals is suboptimal Date: Sun, 28 Aug 2005 23:32:00 -0000 To: gcc-bugzilla@gcc.gnu.org X-SW-Source: 2005-08/txt/msg03227.txt.bz2 List-Id: On Aug 28, 2005, at 7:25 PM, greenrd at greenrd dot org wrote: > > ------- Additional Comments From greenrd at greenrd dot org > 2005-08-28 23:25 ------- > memcmp (which is compiled for i686 in fedora because it is part of > glibc) is > actually less efficient than the current code on my athlon! I was so > surprised, > I ran the memcmp benchmark again, and the results differed by no more > than +/-2%. > > Here are the wallclock times in ms, followed by the advantage of block > compare > over the current code. n is the length of the strings tested. > > n | Current | block compare | memcmp | Advantage of block compare > ------------------------------------------------------------------- > 10 | 10717 | 9236 | 11957 | 16% > 30 | 16427 | 14618 | 19884 | 12% > 50 | 22181 | 17539 | 27550 | 26% > 70 | 28052 | 20978 | 35243 | 34% > 90 | 32966 | 24695 | 42815 | 33% > 110 | 42975 | 28453 | 55036 | 51% > > All these tests were done on x86 with the same -O, -g and -f flags as > make > bootstrap uses by default, using LD_PRELOAD to "hot-replace" the code, > and > without the assertion enabled in the benchmark. This seems like something glibc's memcmp should be doing also, could you report a bug to glibc about this comparison? Also glibc's memcmp could be improved by doing 128 byte (SSE2 and altivec) comparison at a time so we get a nice speed up there too. -- Pinski