public inbox for java-prs@sourceware.org
help / color / mirror / Atom feed
From: "greenrd at greenrd dot org" <gcc-bugzilla@gcc.gnu.org>
To: java-prs@gcc.gnu.org
Subject: [Bug libgcj/23495] java.lang.String.equals is suboptimal
Date: Tue, 30 Aug 2005 01:17:00 -0000	[thread overview]
Message-ID: <20050830011710.3630.qmail@sourceware.org> (raw)
In-Reply-To: <20050820162349.23495.greenrd@greenrd.org>


------- Additional Comments From greenrd at greenrd dot org  2005-08-30 01:17 -------
(In reply to comment #7)
> This seems like something glibc's memcmp should be doing also, could
> you report a bug to glibc about this comparison?

Actually I was wrong - it's not glibc's memcmp that's being used here, it's the
gcc inlined memcmp (see http://sources.redhat.com/bugzilla/show_bug.cgi?id=1262
), which uses the "CISC-style" instructions REP MOVSB. This performs badly in
_every_ case on athlon-xp compared to a "RISC-style" loop. (Indeed this is
documented - it's surprising that gcc has been using the wrong substitution for
so long!) So I will submit a more conservative bug about changing the inlined
memcmp into a loop, against gcc. And will test it on pentium 4 as well.

The block-compare is harder to argue for at the gcc level because it is quite
complicated for the case of memcmp on big-endian (see the glibc implementation)
and therefore probably isn't a good case for inlining, at least not on x86.

However, the block-compare makes perfect sense for the simpler case of
java.lang.String.equals, as my results show.

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23495


  parent reply	other threads:[~2005-08-30  1:17 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
2005-08-30  1:17 ` greenrd at greenrd dot org [this message]
     [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=20050830011710.3630.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).