On 11/17/06, Stefano Bagnara <[EMAIL PROTECTED]> wrote:
----
Output code 2 from jdk 1.4
 > String s2 = s + "test" + s1 + "test" + i;
----
Output code 2 from jdk 1.5
 > String s2 = (new StringBuilder()).append(s).append("test")
 >     .append(s1).append("test").append(i).toString();

I also ran with jdk5 that code in a loop of 1 million iterations using
foo = "foo" and bar = "bar" (this is FAR from any realistic scenario).

<sigh> Microbenchmarking, again! ;-)
Could it be you are testing loop optimization here? ;-)

What also is totally obscured by the whole discussion, is to set in
relation the max performance difference of the different logging
implementations discussed here - the "delta" -  to the cost of the
rest of the method. Only if delta is a significant cost (a "hot spot")
it is worth talking about optimizing it before optimizing everything
else.

 Bernd

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to