RE: Re: [drlvm] string interning in java

2006-07-29 Thread Nathan Beyer
> -Original Message- > From: Robert Lougher [mailto:[EMAIL PROTECTED] > Sent: Saturday, July 29, 2006 5:28 AM > To: harmony-dev@incubator.apache.org > Subject: Re: Re: [drlvm] string interning in java > > On 7/29/06, Nathan Beyer <[EMAIL PROTECTED]> wrote:

Re: Re: [drlvm] string interning in java

2006-07-29 Thread Alex Blewitt
On 29/07/06, Salikh Zakirov <[EMAIL PROTECTED]> wrote: Still, we need to have this functionality, because it is in spec. True, intern() is part of the spec, and GC-intern() will be much better :-) > However, by hard-coding the message like this, you're > guaranteeing that the VM will intern()

Re: Re: Re: [drlvm] string interning in java

2006-07-29 Thread Alex Blewitt
On 29/07/06, Robert Lougher <[EMAIL PROTECTED]> wrote: Which implies that freeing of the dynamically loaded string when the class is unloaded is something special. It is not. Nor is an interned string a memory leak. It will be collected when there are no more references to it like any other o

Re: Re: [drlvm] string interning in java

2006-07-29 Thread Robert Lougher
On 7/29/06, Nathan Beyer <[EMAIL PROTECTED]> wrote: > -Original Message- > From: Robert Lougher [mailto:[EMAIL PROTECTED] > Sent: Friday, July 28, 2006 7:40 PM > To: harmony-dev@incubator.apache.org > Subject: Re: Re: [drlvm] string interning in java > &g

Re: Re: Re: [drlvm] string interning in java

2006-07-29 Thread Alex Blewitt
On 29/07/06, Robert Lougher <[EMAIL PROTECTED]> wrote: The interned String table should be garbage-collected. If the only reference to an interned String is from the class constant pool it will be collected when the class is unloaded. If the intern table is preventing Strings from being collect

RE: Re: [drlvm] string interning in java

2006-07-28 Thread Nathan Beyer
> -Original Message- > From: Robert Lougher [mailto:[EMAIL PROTECTED] > Sent: Friday, July 28, 2006 7:40 PM > To: harmony-dev@incubator.apache.org > Subject: Re: Re: [drlvm] string interning in java > > Hi, > > On 7/29/06, Alex Blewitt <[EMAIL PROTECTED]&g

Re: Re: [drlvm] string interning in java

2006-07-28 Thread Robert Lougher
Hi, On 7/29/06, Alex Blewitt <[EMAIL PROTECTED]> wrote: On 28/07/06, Salikh Zakirov <[EMAIL PROTECTED]> wrote: > Alex Blewitt wrote: Importantly, it explains why the Eclipse NLS class uses static string variables to refer to messages, and not to String literals for exactly this reason. If you u

Re: Re: [drlvm] string interning in java

2006-07-28 Thread Alex Blewitt
On 28/07/06, Salikh Zakirov <[EMAIL PROTECTED]> wrote: Alex Blewitt wrote: > There's a heck of a lot wrong with intern() My original observation was that interning makes perfect sense for localized log messages, because the code like println(MessageBundle.get("how are you?")); Yes, but I

Re: Re: [drlvm] string interning in java

2006-07-28 Thread Alex Blewitt
There's a heck of a lot wrong with intern(). 1) People claim inefficiencies, without actually measuring them (see other points I've made about permature optimisation) 2) The claim that performing an intern() reduces comparisons (because you just do a pointer compare) is, in most cases, completely