Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #27886
| Path | csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail |
|---|---|
| From | Eric Sosman <esosman@comcast-dot-net.invalid> |
| Newsgroups | comp.lang.java.programmer |
| Subject | Re: how actually string store in java machine |
| Date | Thu, 27 Mar 2014 08:54:36 -0400 |
| Organization | A noiseless patient Spider |
| Lines | 36 |
| Message-ID | <lh172f$mkp$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> <lgslj6$k81$2@news.albasani.net> <b9f4j99knq24nqdmi1ultckkm82ecem7v6@4ax.com> <lguruv$1dm$1@dont-email.me> <lgv48i$528$1@dont-email.me> <lgvoc6$b1n$1@dont-email.me> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=ISO-8859-1; format=flowed |
| Content-Transfer-Encoding | 7bit |
| Injection-Date | Thu, 27 Mar 2014 12:54:39 +0000 (UTC) |
| Injection-Info | mx05.eternal-september.org; posting-host="bd4e1cba8d8592bec5d5ed9e4537fbfd"; logging-data="23193"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/FEb/TahsSlQE+Dtyu6pGD" |
| User-Agent | Mozilla/5.0 (Windows NT 5.1; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 |
| In-Reply-To | <lgvoc6$b1n$1@dont-email.me> |
| Cancel-Lock | sha1:3BQB4zVNfQx2k9/yoEniMMd275w= |
| Xref | csiph.com comp.lang.java.programmer:27886 |
Show key headers only | View raw
On 3/26/2014 7:37 PM, markspace wrote:
> On 3/26/2014 10:54 AM, Eric Sosman wrote:
>
>> ... prints
>>
>> Foo.HELLO == "Hello": true
>>
>> ... on my Java 1.7.0_51 system. You might also want to re-read
>> Section 3.10.5 of the Java Language Specification; for Java 7 and 8
>> it reads (in part)
>
>
> Well, that I did not expect. No wonder it takes so long to load a class
> if each class has to be parsed for string literals and each one added to
> a hash map someplace.
There's surely no parsing to speak of. The string literals'
data arrives in the class' constant pool, along with a lot of
other stuff, and is pretty easily located therein. I suspect
that the time required to fish them out and intern() them is
peanuts compared to the time spent on the rest of class loading
and initialization (but I have absolutely no data to support my
suspicion). And then there's the JIT ...
> Grrr, I'm actually mad about that. String are *required* to be
> intern'd?! That's really funky.
I think so, too. It feels like an implementation detail
that might better have been left unspecified. Similarly, I
feel that the span of pooled Integer and suchlike objects ought
not to be part of the language definition, but should have been
left to the discretion of a JVM's implementors.
--
Eric Sosman
esosman@comcast-dot-net.invalid
Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll 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