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


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

Re: how actually string store in java machine

Path csiph.com!usenet.pasdenom.info!aioe.org!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From markspace <markspace@nospam.nospam>
Newsgroups comp.lang.java.programmer
Subject Re: how actually string store in java machine
Date Tue, 25 Mar 2014 14:00:34 -0700
Organization A noiseless patient Spider
Lines 44
Message-ID <lgsqpm$nc4$1@dont-email.me> (permalink)
References <8f7d9272-4b25-44c9-8c31-93ea754be4cb@googlegroups.com> <lgsflf$pua$1@dont-email.me> <lgslfc$k81$1@news.albasani.net> <lgsnog$ugk$1@dont-email.me> <lgsoah$3r1$1@dont-email.me> <lgsoel$3r1$2@dont-email.me>
Mime-Version 1.0
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
Injection-Date Tue, 25 Mar 2014 21:00:38 +0000 (UTC)
Injection-Info mx05.eternal-september.org; posting-host="5aa64ebf9a53573f97c75abba936b0e2"; logging-data="23940"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+iB/VeLKpYCX6iKxX2ckT/uJgnUOg2ovY="
User-Agent Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0
In-Reply-To <lgsoel$3r1$2@dont-email.me>
Cancel-Lock sha1:/8w0jQ4RUjBwoQpBJz1r/azwoD4=
Xref csiph.com comp.lang.java.programmer:27865

Show key headers only | View raw


On 3/25/2014 1:19 PM, Jeff Higgins wrote:
> On 03/25/2014 04:16 PM, Jeff Higgins wrote:
>> <http://java-performance.info/string-intern-java-7-8-part-3/#more-667>
> Oops.
> <http://java-performance.info/string-intern-java-7-8-part-3>
>
>


Quoted from your link:


"Summary

     "Despite serious optimizations done in the String.intern() 
implementation in Java 7+, it still takes a noticeable time to run 
(noticeable for CPU sensitive applications). The simple example in this 
article runs 3.5 times faster without calls to String.intern(). You 
should not use String.intern() as a safety net, passing every long 
living string into it. Instead process only fields with a limited number 
of possible distinct values (for example, states/provinces if processing 
addresses) - memory savings in this situation will definitely pay off 
the initial CPU costs of String.intern()."

* * *


Basically the "you should not use String.intern() ... passing every ... 
string into it."  Is the money shot.  If you have a string that's 
obviously repetitious (like a field for states or countries) it might be 
useful, other wise not so much.

Also, using String.intern() heavily requires that you increase memory 
available to it.


"The requirement to set -XX:StringTableSize=N JVM parameter in advance 
and dealing with its fixed value"


That alone would make me want to use a HashSet instead.


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


Thread

how actually string store in java machine Rishipal Singh <95rishipal@gmail.com> - 2014-03-25 09:56 -0700
  Re: how actually string store in java machine Roedy Green <see_website@mindprod.com.invalid> - 2014-03-25 10:32 -0700
  Re: how actually string store in java machine Roedy Green <see_website@mindprod.com.invalid> - 2014-03-25 10:33 -0700
  Re: how actually string store in java machine Jeff Higgins <jeff@invalid.invalid> - 2014-03-25 13:49 -0400
    Re: how actually string store in java machine Jan Burse <janburse@fastmail.fm> - 2014-03-25 20:29 +0100
      Re: how actually string store in java machine Jan Burse <janburse@fastmail.fm> - 2014-03-25 20:31 +0100
        Re: how actually string store in java machine Roedy Green <see_website@mindprod.com.invalid> - 2014-03-25 19:37 -0700
          Re: how actually string store in java machine Jan Burse <janburse@fastmail.fm> - 2014-03-26 09:03 +0100
            Re: how actually string store in java machine Jan Burse <janburse@fastmail.fm> - 2014-03-26 09:11 +0100
            Re: how actually string store in java machine Jan Burse <janburse@fastmail.fm> - 2014-03-27 10:27 +0100
          Re: how actually string store in java machine markspace <markspace@nospam.nospam> - 2014-03-26 08:32 -0700
            Re: how actually string store in java machine Eric Sosman <esosman@comcast-dot-net.invalid> - 2014-03-26 13:54 -0400
              Re: how actually string store in java machine taqmcg@gmail.com - 2014-03-26 12:57 -0700
              Re: how actually string store in java machine markspace <markspace@nospam.nospam> - 2014-03-26 16:37 -0700
                Re: how actually string store in java machine Eric Sosman <esosman@comcast-dot-net.invalid> - 2014-03-27 08:54 -0400
                Re: how actually string store in java machine taqmcg@gmail.com - 2014-03-27 08:23 -0700
                Re: how actually string store in java machine Eric Sosman <esosman@comcast-dot-net.invalid> - 2014-03-27 11:50 -0400
                Re: how actually string store in java machine taqmcg@gmail.com - 2014-03-28 06:58 -0700
                Re: how actually string store in java machine Eric Sosman <esosman@comcast-dot-net.invalid> - 2014-03-28 11:02 -0400
                Re: how actually string store in java machine taqmcg@gmail.com - 2014-04-02 05:47 -0700
                Re: how actually string store in java machine Eric Sosman <esosman@comcast-dot-net.invalid> - 2014-04-02 10:15 -0400
                Re: how actually string store in java machine taqmcg@gmail.com - 2014-04-03 08:58 -0700
            Re: how actually string store in java machine Roedy Green <see_website@mindprod.com.invalid> - 2014-03-26 17:07 -0700
      Re: how actually string store in java machine Jeff Higgins <jeff@invalid.invalid> - 2014-03-25 16:07 -0400
        Re: how actually string store in java machine Jeff Higgins <jeff@invalid.invalid> - 2014-03-25 16:16 -0400
          Re: how actually string store in java machine Jeff Higgins <jeff@invalid.invalid> - 2014-03-25 16:19 -0400
            Re: how actually string store in java machine markspace <markspace@nospam.nospam> - 2014-03-25 14:00 -0700
              Re: how actually string store in java machine Jeff Higgins <jeff@invalid.invalid> - 2014-03-25 17:21 -0400
                Re: how actually string store in java machine Jeff Higgins <jeff@invalid.invalid> - 2014-03-26 11:40 -0400
                Re: how actually string store in java machine Roedy Green <see_website@mindprod.com.invalid> - 2014-03-26 17:46 -0700
  Re: how actually string store in java machine Lew <lewbloch@gmail.com> - 2014-03-25 15:07 -0700

csiph-web