public inbox for java-prs@sourceware.org
help / color / mirror / Atom feed
From: "pinskia at physics dot uc dot edu" <gcc-bugzilla@gcc.gnu.org>
To: java-prs@gcc.gnu.org
Subject: [Bug libgcj/23495] java.lang.String.equals is suboptimal
Date: Sun, 28 Aug 2005 23:32:00 -0000 [thread overview]
Message-ID: <20050828233214.19852.qmail@sourceware.org> (raw)
In-Reply-To: <20050820162349.23495.greenrd@greenrd.org>
------- Additional Comments From pinskia at physics dot uc dot edu 2005-08-28 23:32 -------
Subject: Re: java.lang.String.equals is suboptimal
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
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23495
next prev parent reply other threads:[~2005-08-28 23:32 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-08-20 16:23 [Bug libgcj/23495] New: " greenrd at greenrd dot org
2005-08-20 16:29 ` [Bug libgcj/23495] " greenrd at greenrd dot org
2005-08-20 19:10 ` pinskia at gcc dot gnu dot org
2005-08-20 19:41 ` pinskia at gcc dot gnu dot org
2005-08-22 21:54 ` tromey at gcc dot gnu dot org
2005-08-28 23:25 ` greenrd at greenrd dot org
2005-08-28 23:32 ` pinskia at physics dot uc dot edu [this message]
2005-08-30 1:17 ` greenrd at greenrd dot org
[not found] <bug-23495-11308@http.gcc.gnu.org/bugzilla/>
2006-02-06 22:12 ` tromey at gcc dot gnu dot org
2006-03-08 0:54 ` tromey at gcc dot gnu dot org
2006-03-08 14:39 ` greenrd at gcc dot gnu dot org
2006-03-09 19:17 ` tromey at gcc dot gnu dot org
2006-03-10 0:39 ` tromey at gcc dot gnu dot org
2006-03-10 0:48 ` tromey at gcc dot gnu dot org
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20050828233214.19852.qmail@sourceware.org \
--to=gcc-bugzilla@gcc.gnu.org \
--cc=java-prs@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).