Message from discussion
more efficient way to do String concat
Received: by 10.42.169.67 with SMTP id a3mr9541703icz.8.1333531309385;
Wed, 04 Apr 2012 02:21:49 -0700 (PDT)
X-BeenThere: mozilla-rhino@googlegroups.com
Received: by 10.50.56.204 with SMTP id c12ls11924263igq.2.canary; Wed, 04 Apr
2012 02:21:48 -0700 (PDT)
Received: by 10.50.41.138 with SMTP id f10mr350709igl.0.1333531308050;
Wed, 04 Apr 2012 02:21:48 -0700 (PDT)
Received: by 10.50.41.138 with SMTP id f10mr350708igl.0.1333531308039;
Wed, 04 Apr 2012 02:21:48 -0700 (PDT)
Return-Path: <hann...@gmail.com>
Received: from mail-ob0-f177.google.com (mail-ob0-f177.google.com [209.85.214.177])
by gmr-mx.google.com with ESMTPS id hq2si794797igc.3.2012.04.04.02.21.47
(version=TLSv1/SSLv3 cipher=OTHER);
Wed, 04 Apr 2012 02:21:48 -0700 (PDT)
Received-SPF: pass (google.com: domain of hann...@gmail.com designates 209.85.214.177 as permitted sender) client-ip=209.85.214.177;
Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of hann...@gmail.com designates 209.85.214.177 as permitted sender) smtp.mail=hann...@gmail.com; dkim=pass header...@gmail.com
Received: by mail-ob0-f177.google.com with SMTP id x4so93841obh.8
for <mozilla-rhino@googlegroups.com>; Wed, 04 Apr 2012 02:21:47 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20120113;
h=mime-version:in-reply-to:references:date:message-id:subject:from:to
:content-type:content-transfer-encoding;
bh=zGAS8taCFc39hCWyNAHbUou1p7cYxFjMJ08FdJXsvgw=;
b=kP6VdEzpp1WV+0Maj2WTUR6M3jwZ/5HjxmEjiCSEHg6YVu+i5WuAJ+X1NRv6T7/LBx
LRbtZfysg9ZdiNjkuhpF1fgubTRo8ff3J186SBEtEZhpxX4h/EdnK3B9OCxtMVoRIj/n
fUM97q71Apj4QORYlicp2TTUkpdWUOYCC+WDvtnYyT0EchCeZqE80XKBxbTFq4IgQRut
x9oQ2eWzNWUcm95i1NG1A7npCL1lVB5OkazBul4+n2ws2eCyIXZC6I1pQrnRwoeumq/T
AzsOVmD5Db6wHtTC0K9E0m98SqLvGnWBKb7IpFwe/3pnaHZKgSuGs+IR+/HZih99wwm6
uYRg==
MIME-Version: 1.0
Received: by 10.60.24.164 with SMTP id v4mr23053390oef.51.1333531307848; Wed,
04 Apr 2012 02:21:47 -0700 (PDT)
Received: by 10.182.182.5 with HTTP; Wed, 4 Apr 2012 02:21:47 -0700 (PDT)
In-Reply-To: <CAG6jpzb03N5ZRvPvRQK-VkWw2RgBEJCpmXF7wvsZveazyRE...@mail.gmail.com>
References: <CAG6jpza8e5W1ULO+cc9sgrUKX6mXu65s9y5XsN+tMG-reeA...@mail.gmail.com>
<CAGtyb5y7SrgCO7kN9WR=Aa2pjN0ZZYwSfcnQE9YHKMGRaAq...@mail.gmail.com>
<CAG6jpzb03N5ZRvPvRQK-VkWw2RgBEJCpmXF7wvsZveazyRE...@mail.gmail.com>
Date: Wed, 4 Apr 2012 11:21:47 +0200
Message-ID: <CAGtyb5zX8zQ3KJyu7_hbwtEGfkmu7nvuN7v475D8xJVw6jO...@mail.gmail.com>
Subject: Re: [mozilla-rhino] more efficient way to do String concat
From: =?ISO-8859-1?Q?Hannes_Walln=F6fer?= <hann...@gmail.com>
To: mozilla-rhino@googlegroups.com
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
1.7 is on the master branch.
Hannes
2012/4/4 Wei Xue <wei.xu...@gmail.com>:
> Hannes, what's the branch name for 1.7R4? Thanks. I don't see it in the
> following list.
>
> Rhino1_7R3_RELEASE: 1.70
> head: 1.62
> Rhino1_7R2_BRANCH: 1.62.0.2
> BEFORE_AST: 1.62
> Rhino1_7R1_BRANCH: 1.59.0.2
> Rhino1_6R7_BRANCH: 1.57.0.4
> Rhino1_6R6_RELEASE: 1.57
> Rhino1_6R6_BRANCH: 1.57.0.2
> RHINO_2007_02_05_08_30: 1.1.1.1
> MOZILLA: 1.1.1
> Rhino1_6R5_RELEASE: 1.52.2.2
> Rhino1_6R4_RELEASE: 1.52
> Rhino1_6R3_PATCH: 1.52.0.2
> JS_1_7_ALPHA_MERGE: 1.52
> Rhino1_6R3_RELEASE: 1.52
> SUNBIRD_0_3a2_RELEASE: 1.52
> Rhino1_6R2_RELEASE: 1.51
> PREFERENCES_20050201_BRANCH: 1.49.0.2
> PREFERENCES_20050201_BASE: 1.49
> before_simpler_undefined_280047: 1.49
> Rhino1_6R1_RELEASE: 1.49
> BEFORE_E4X: 1.44
> Rhino150R5_RELEASE: 1.38
> before_225831_merge: 1.37
> templess_bytecode_225831: 1.37.0.2
> before_less_classes_optimizer: 1.33
> Rhino150R4_1_RELEASE: 1.29
> Rhino150R4_BRANCH: 1.29.0.2
> Rhino150R4_RELEASE: 1.29
> less_static: 1.21.0.2
> Rhino150R3_RELEASE: 1.20
> EDITOR_EMBEDDING_20011025_BRANCH: 1.16.0.2
> EDITOR_EMBEDDING_20011025_BASE: 1.16
> Rhino150R2_RELEASE: 1.20
> Rhino150R2_BRANCH: 1.20.0.2
> before_new_natives: 1.11
> before_jsdebugger: 1.9
> EXP_DEBUGGER: 1.8.0.2
> Rhino150R1_RELEASE: 1.8
> Rhino150R1_BRANCH: 1.8.0.4
> ClassGen_BRANCH: 1.4.0.2
> Rhino140R3_BRANCH: 1.1.0.2
> Rhino140R3_RELEASE: 1.1
>
>
> 2012/3/14 Hannes Walln=F6fer <hann...@gmail.com>
>>
>> Current Rhino git snapshot and 1.7R4 which is due very soon has
>> optimized String concatenation, so using + to build strings should be
>> comparable to array join() in terms of performance.
>>
>> Hannes
>>
>> 2012/3/13 Wei Xue <wei.xu...@gmail.com>:
>> > Some of our scripts have a lot of String concat which causes high GC i=
n
>> > the
>> > server causing by allocating array. =A0 I wonder in Rhino, is there
>> > equivalent
>> > of StringBuffer?=A0 If I write my scrip in the following way, will it =
be
>> > efficient when running in Rhino?
>> >
>> > var buf=3D [];
>> > buf.push('some string');
>> > buf.toString();
>> >
>> > to replace following:
>> >
>> > var buf=3D'';
>> > buf+=3D'some string';
>> >
>> > Thanks!
>> >
>> > Michelle
>
>