Paul Clapham wrote:Who said it improves performance? And more specifically, what did they mean by that?
Paul Clapham wrote:Then why didn't you just ask that question, with that reference? It was really a waste of time to replace it by such a vague question.
Rohan Deshmkh wrote:
Paul Clapham wrote:Then why didn't you just ask that question, with that reference? It was really a waste of time to replace it by such a vague question.
Because i wanted to ask how does it improve performance when more and more strings are created in the heap.If i just wanted to know how does that improve performance then your argument would have been valid.
Rohan Deshmkh wrote:Because i wanted to ask how does it improve performance when more and more strings are created in the heap.If i just wanted to know how does that improve performance then your argument would have been valid.
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Jeff Verdegan wrote:
Rohan Deshmkh wrote:
Paul Clapham wrote:Then why didn't you just ask that question, with that reference? It was really a waste of time to replace it by such a vague question.
Because i wanted to ask how does it improve performance when more and more strings are created in the heap.If i just wanted to know how does that improve performance then your argument would have been valid.
Not to belabor the point, but you could have both provided the context initially and added your own specific query about creating additional objects. Then we all would have had the full relevant picture from the beginning.
Note that nobody's trying to pick on you here. We simply want to encourage clear communication of all the relevant information so that the discussion can be as effective as possible, focusing on the technical matter at hand rather than on meta questions about what the question is. :)
Paul Clapham wrote:It's ironic, really... the technique touted in that Stack Overflow answer which you referred to? It was recently abandoned by the writers of the standard Java classes, apparently because of the reasons outlined in the comments on that answer.
So you might want to reread the answer, along with the comments. If there's something specific you don't understand about it, then ask that specific question. It's really quite an instructive answer-and-comments set, in that it ends up denying the concept of "performance" as a one-dimensional measure of goodness.
Paul Clapham wrote:
But the people who wrote the standard API classes were writing code for the whole world to use. And not only that, back in 1997 they were working in an environment full of magazine articles and web pages which said "Java is slow". So given that environment, they were under pressure to produce performance improvements. The feature about sharing the underlying character array may have been implemented for that reason, but that's just me speculating.