siva chaitanya wrote:Thank you changu i came to know that by using + operator to combine two strings degrades the performance...
The fact is that neither you nor I know whether your above statement is true; and you should NEVER rely on anecdotal evidence when dealing with performance.Michael A. Jackson wrote:RULES OF OPTIMIZATION
1. Don't do it.
2 (For experts only) Don't do it YET.
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
siva chaitanya wrote:Thank you changu i came to know that by using + operator to combine two strings degrades the performance,
Jesper de Jong wrote:I agree with Winston, what you should certainly not do from now on is always write .concat(...) every time instead of using + because you think that .concat(...) is faster.
Jeff Verdegan wrote:
The compiler will turn it into as efficient a set of StringBuilder.append() calls and compile time constants as you could have yourself, but this way is easier to read than all the append()s.
The biggest gamble will be to ask a question whose answer you know in that it will challenge your theory | www.TechAspire.blogspot.in
Rajdeep Biswas wrote:
Jeff Verdegan wrote:
The compiler will turn it into as efficient a set of StringBuilder.append() calls and compile time constants as you could have yourself, but this way is easier to read than all the append()s.
Is that so? Is it JVM specific implementation?
P.S. I thought that the JVM searches for these literals in string pool, puts into pool if not already available, and then concatenates all, puts the concatenated string into the pool and returns the reference to it.
Regards,
The biggest gamble will be to ask a question whose answer you know in that it will challenge your theory | www.TechAspire.blogspot.in
Did you see how Paul cut 87% off of his electric heat bill with 82 watts of micro heaters? |