Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #38568

Re: JDK 9 strings very slow

From Eric Sosman <esosman@comcast-dot-net.invalid>
Newsgroups comp.lang.java.programmer
Subject Re: JDK 9 strings very slow
Date 2018-08-27 13:32 -0400
Organization A noiseless patient Spider
Message-ID <pm1cjk$959$1@dont-email.me> (permalink)
References (2 earlier) <plv2vr$59l$1@dont-email.me> <plv6ae$6kk$1@news.albasani.net> <pm120r$e1f$1@dont-email.me> <pm1aoo$400$1@news.albasani.net> <pm1bo4$ea4$1@news.albasani.net>

Show all headers | View raw


On 8/27/2018 1:17 PM, j4n bur53 wrote:
> But I still see some problems with this approach,
> like for example. Did Java amend equals, and like
> do a check alfa.value==beta.value ?
> 
> I only find in JDK 8:
> 
>          if (this == anObject) {
>              return true;
>          }
>          if (anObject instanceof String) {
>              String anotherString = (String)anObject;
>              int n = value.length;
>              if (n == anotherString.value.length) {
>                  char v1[] = value;
>                  char v2[] = anotherString.value;
>                  int i = 0;
>                  while (n-- != 0) {
>                      if (v1[i] != v2[i])
>                          return false;
>                      i++;
>                  }
>                  return true;
>              }
>          }
>          return false;

     This Java source code may be somewhat misleading.  I'm not
certain, but here and there in the discussion-and-issue pages
you'll find references to "the HotSpot VM's intrinsic string
operations" -- which suggests (to me) that the JVM might have
its own internal native implementations of some String methods.
The visible Java code might not execute at all, or might execute
only on JVM's that don't "internal-ize" quite so aggressively.

     Permit me to ask: Why are the internals of the JVM's String
handling of such interest to you?  Is it just laudable curiosity,
or are you confronting a difficulty of some kind?

-- 
esosman@comcast-dot-net.invalid
Eight hundred seventy-seven days to go.

Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

JDK 9 strings very slow j4n bur53 <janburse@fastmail.fm> - 2018-07-27 15:47 +0200
  Re: JDK 9 strings very slow j4n bur53 <janburse@fastmail.fm> - 2018-07-27 15:56 +0200
    Re: JDK 9 strings very slow j4n bur53 <janburse@fastmail.fm> - 2018-07-27 16:21 +0200
  Re: JDK 9 strings very slow Eric Sosman <esosman@comcast-dot-net.invalid> - 2018-07-27 10:11 -0400
    Re: JDK 9 strings very slow j4n bur53 <janburse@fastmail.fm> - 2018-07-27 16:23 +0200
      Re: JDK 9 strings very slow j4n bur53 <janburse@fastmail.fm> - 2018-07-27 16:25 +0200
  Re: JDK 9 strings very slow bursejan@gmail.com - 2018-08-26 09:44 -0700
    Re: JDK 9 strings very slow Eric Sosman <esosman@comcast-dot-net.invalid> - 2018-08-26 16:36 -0400
      Re: JDK 9 strings very slow j4n bur53 <janburse@fastmail.fm> - 2018-08-26 23:33 +0200
        Re: JDK 9 strings very slow Eric Sosman <esosman@comcast-dot-net.invalid> - 2018-08-27 10:31 -0400
          Re: JDK 9 strings very slow j4n bur53 <janburse@fastmail.fm> - 2018-08-27 19:01 +0200
            Re: JDK 9 strings very slow j4n bur53 <janburse@fastmail.fm> - 2018-08-27 19:17 +0200
              Re: JDK 9 strings very slow Eric Sosman <esosman@comcast-dot-net.invalid> - 2018-08-27 13:32 -0400
                Re: JDK 9 strings very slow bursejan@gmail.com - 2018-08-27 10:49 -0700
                Re: JDK 9 strings very slow bursejan@gmail.com - 2018-08-30 18:56 -0700
                Re: JDK 9 strings very slow bursejan@gmail.com - 2018-08-31 00:29 -0700
                Re: JDK 9 strings very slow j4n bur53 <janburse@fastmail.fm> - 2018-08-31 09:56 +0200

csiph-web