Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!nuzba.szn.dk!pnx.dk!fu-berlin.de!uni-berlin.de!news.dfncis.de!not-for-mail From: =?ISO-8859-1?Q?Sven_K=F6hler?= Newsgroups: comp.lang.java.programmer Subject: Re: FastCat 'performance' Date: Thu, 28 Feb 2013 05:19:46 +0100 Lines: 18 Message-ID: References: <1rcs4eq420jj8.3menl13xfrpv.dlg@40tude.net> <89669b41-7a35-434e-90cd-57f7342ee70b@googlegroups.com> <1h6w3eeq8kfys$.kfwnlzg0axst.dlg@40tude.net> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: news.dfncis.de HkC41+tNGzRBejpt6nv13wtsLINdL+JqBBmQCHcBlqgwwwk/B2XvWXSZ442NKmNP5b4at6vhLx Cancel-Lock: sha1:yaOe0fndZVTa0UdatyQNbRD4jik= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130223 Thunderbird/17.0.3 In-Reply-To: <1h6w3eeq8kfys$.kfwnlzg0axst.dlg@40tude.net> Xref: csiph.com comp.lang.java.programmer:22608 Am 27.02.2013 22:51, schrieb Joerg Meier: > On Wed, 27 Feb 2013 13:42:00 -0800 (PST), Lew wrote: > >> How does it compare to using String +? > > I didn't include + in my initial benchmark because I learned some time ago > that both javac as well as HotSpot will just convert it to StringBuilder > behind the scenes in most circumstances. Java Compilers will substitute any + operations on String with calls to StringBuffer (-source 1.3 and below) or StringBuilder (-source 1.4 or above). I'm not aware, of any optimizations within the JVM (e.g. Hotspot), but at byte-code level there is no such thing as a + operator for strings. Regards, Sven