Path: csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!border3.nntp.dca.giganews.com!Xl.tags.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local2.nntp.dca.giganews.com!nntp.posted.palinacquisition!news.posted.palinacquisition.POSTED!not-for-mail NNTP-Posting-Date: Sun, 18 Sep 2011 09:28:37 -0500 Date: Sun, 18 Sep 2011 07:28:37 -0700 From: Peter Duniho User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.2.22) Gecko/20110902 Thunderbird/3.1.14 MIME-Version: 1.0 Newsgroups: comp.lang.java.programmer Subject: Re: StringBuilder References: <96f358c8-a024-40db-b60b-300186c2f813@o10g2000vby.googlegroups.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Message-ID: Lines: 26 X-Usenet-Provider: http://www.giganews.com NNTP-Posting-Host: 50.46.118.188 X-Trace: sv3-07q9LLRs0Ry9aCXF6RrZ00B+YAAYhJj9KN1+m+BJnpmAhelF1QGPvi0Rhlv56lxhs/SSKcHXpI3DXhn!aU24oRAXW5iU7/CLRrY98AudzSSbGQsTrUpcTOp5DOum66ib5zk+CwhNw3UXvjbuQPyAkMIm6N4O!2PTy7YDuVGl6qwqVcrSm5ManMHQY8BEt+dis0yth0Lo= X-Complaints-To: abuse@iinet.com X-DMCA-Complaints-To: abuse@iinet.com X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 2538 Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:8130 On 9/18/11 12:54 AM, Jan Burse wrote: > Peter Duniho schrieb: > >> In any case, if Java does _not_ implement it that way, I suspect that's > > Well, I wouldn't say its a matter of *Java*. Its a matter > of the given JDK how it is implementented. *Java* defines > the contract but there are many implementations. It's true, I use "Java" generically here. So? > [...] > I guess it is more about performance tuning than removing > bottlenecks. And any performance gain is only seen in > programs that make heavy use of StringBuilder. Such > measurements have already been done over and over. See > for example (not exactly measurig toString()): > > +=: 546 ms > StringBuilder, default initial capacity: 30ms > StringBuilder, exact initial capacity: 10ms > > http://christian.bloggingon.net/archive/2008/09/06/performance-vorteile-bei-der-verwendung-von-stringbuilder.aspx Such measurements are meaningless out of context. The point is how much time is spent in StringBuilder _for a specific application_.