Title: [jdjlist] RE: Slow: string += string

> David Gallardo wrote:

      x = "a" + 4 + "c"


"is compiled to the equivalent of:

      x = new StringBuffer().append("a").append(4).append("c")
                            .toString()

</snip>

I tested exactly this example (I had about 1000 String objects) under 1.3 with aforementioned sad results.  And 1.4 to my knowledge still does not optimize the += in the loop, although I've never run the actual test myself.  Perhaps I will when we switch to the new JDK.

Greg

____________________________________________________
To change your JDJList options, please visit:
http://www.sys-con.com/java/list.cfm

Be respectful! Clean up your posts before replying
____________________________________________________

Reply via email to