Re: [cp-patches] RFC: use helper method to clone char array in java.lang.String

2008-02-07 Thread Ian Rogers
Tom Tromey wrote: Ian == Ian Rogers [EMAIL PROTECTED] writes: Ian Please let me know if you think this patch is suitable for Ian inclusion. It looks fine. I do have one nit, which is that we put spaces around operators... this problem is pervasive in the patch, but here's one

Re: [cp-patches] RFC: use helper method to clone char array in java.lang.String

2008-02-07 Thread Tom Tromey
Ian + * java/lang/String.java Ian + Only copy live portion of String. Use array copies in preference to clone. The ChangeLog entry should mention method names. See other examples in the file, or the GNU coding standards. Otherwise -- looks good to me, thanks. Tom

Re: [cp-patches] RFC: use helper method to clone char array in java.lang.String

2008-02-05 Thread Ian Rogers
Robert Lougher wrote: Hi, On 2/4/08, Ian Rogers [EMAIL PROTECTED] wrote: Hi, xalan performs 1.4 million char array clones per iteration of the normal size DaCapo benchmark. All of the character array clones are coming from java.lang.String. The attached patch changes the use of

Re: [cp-patches] RFC: use helper method to clone char array in java.lang.String

2008-02-05 Thread Ian Rogers
Hello all, here's a revised patch that removes the use of clone in preference to just array copying the live portion of the String. Here are the DaCapo xalan figures: run 1: 97972ms run 2: 97837ms run 3: 95290ms which represents anything from a 0.04% slow down to a 2.8% speed up. There

Re: [cp-patches] RFC: use helper method to clone char array in java.lang.String

2008-02-05 Thread Tom Tromey
Ian == Ian Rogers [EMAIL PROTECTED] writes: Ian Please let me know if you think this patch is suitable for Ian inclusion. It looks fine. I do have one nit, which is that we put spaces around operators... this problem is pervasive in the patch, but here's one example: Ian +newStr[x-offset]

Re: [cp-patches] RFC: use helper method to clone char array in java.lang.String

2008-02-04 Thread Robert Lougher
Hi, On 2/4/08, Ian Rogers [EMAIL PROTECTED] wrote: Hi, xalan performs 1.4 million char array clones per iteration of the normal size DaCapo benchmark. All of the character array clones are coming from java.lang.String. The attached patch changes the use of char[].clone (which maps to

Re: [cp-patches] RFC: use helper method to clone char array in java.lang.String

2008-02-04 Thread Tom Tromey
Ian == Ian Rogers [EMAIL PROTECTED] writes: Ian + private static char[] cloneCharArray(char[] src) Ian + { Ian +char[] copy = new char[src.length]; Ian +VMSystem.arraycopy(src, 0, copy, 0, src.length); Ian +return copy; Ian + } I think it would be better in these places to copy

[cp-patches] RFC: use helper method to clone char array in java.lang.String

2008-02-04 Thread Ian Rogers
Hi, xalan performs 1.4 million char array clones per iteration of the normal size DaCapo benchmark. All of the character array clones are coming from java.lang.String. The attached patch changes the use of char[].clone (which maps to java.lang.Object.clone) to a helper method that allocates