Re: String.equals optimisation

2005-07-11 Thread Per Bothner
Stephen Crawley wrote: [EMAIL PROTECTED] said: I'd be interested to hear of other reasons for Java's requirement to intern all literal strings and constants. Backwards compatibility. At this point we can only conjecture as to why Java was originally defined this way. My guess is that this

Re: String.equals optimisation

2005-07-11 Thread Stephen Crawley
I stand corrected. -- Steve ___ Classpath mailing list Classpath@gnu.org http://lists.gnu.org/mailman/listinfo/classpath

Re: String.equals optimisation

2005-07-11 Thread Stephen Crawley
[EMAIL PROTECTED] said: > I'd be interested to hear of other reasons for Java's requirement to > intern all literal strings and constants. Backwards compatibility. At this point we can only conjecture as to why Java was originally defined this way. My guess is that this decision was made in t

Re: String.equals optimisation

2005-07-11 Thread Simon Kitching
Hi Archie, On Mon, 2005-07-11 at 20:27 -0500, Archie Cobbs wrote: > Simon Kitching wrote:. > > * Class.getName returns strings that have been interned. I don't > > think this is explicitly required by the java specs but is > > certainly true for Sun's JVM and seems likely to be done by > > a

Re: regression in logger?

2005-07-11 Thread Casey Marshall
On Jul 11, 2005, at 4:54 AM, David P Grove wrote: This started showing up in regression tests of Jikes RVM with classpath cvs head recently. I haven't dug deeply, so it could be a latent problem in Jikes RVM that was exposed by a classpath change, rather than a real classpath bug, but migh

Re: String class: hack for ORP 1.0.9

2005-07-11 Thread Archie Cobbs
Simon Kitching wrote: public char[] toCharArray() { // XXX ORP 1.0.9 crashes on (char[]) clone() during bootstrap, so we // omit this optimization for now. // if (count == value.length) // return (char[]) value.clone(); char[] copy = new char[count]; VMSystem.arrayco

Re: String.equals optimisation

2005-07-11 Thread Archie Cobbs
Simon Kitching wrote:. * Class.getName returns strings that have been interned. I don't think this is explicitly required by the java specs but is certainly true for Sun's JVM and seems likely to be done by any sensible JVM. You definitely make some good arguments, but this one is not nec

String class: hack for ORP 1.0.9

2005-07-11 Thread Simon Kitching
Hi, In String.java there is this piece of code: public char[] toCharArray() { // XXX ORP 1.0.9 crashes on (char[]) clone() during bootstrap, so we // omit this optimization for now. // if (count == value.length) // return (char[]) value.clone(); char[] copy = new char[co

Re: String.equals optimisation

2005-07-11 Thread Simon Kitching
On Tue, 2005-07-12 at 11:02 +1200, Simon Kitching wrote: > It would certainly be nice to know that collection methods will > automatically work more efficiently when the objects being manipulated > are String objects that have been interned (of course String.intern has > to be used appropriately).

String.equals optimisation

2005-07-11 Thread Simon Kitching
Hi, I think the performance of String.equals could be improved. Currently: public boolean equals(Object anObject) { if (! (anObject instanceof String)) return false; String str2 = (String) anObject; if (count != str2.count) return false; if (value == str2.value &&

Re: regression in logger?

2005-07-11 Thread Archie Cobbs
David P Grove wrote: > This started showing up in regression tests of Jikes RVM with classpath > cvs head recently. I haven't dug deeply, so it could be a latent problem > in Jikes RVM that was exposed by a classpath change, rather than a real > classpath bug, but might still be worth mentioning.

regression in logger?

2005-07-11 Thread David P Grove
This started showing up in regression tests of Jikes RVM with classpath cvs head recently. I haven't dug deeply, so it could be a latent problem in Jikes RVM that was exposed by a classpath change, rather than a real classpath bug, but might still be worth mentioning. The failing program is S