Bug 1129757 - Improve parse-mega-huge-array.js test performance. r=Waldo
authorTooru Fujisawa <arai_a@mac.com>
Sat, 14 Feb 2015 14:33:43 +0900
changeset 256344 8041e061077776d18cf39fe381e861fa34c77dc7
parent 256343 2c72917f420bdd6ec68db2048c1f3db7ce7ef4fe
child 256345 9507662057de474ed29fd40550635332fe7a1668
push id4610
push userjlund@mozilla.com
push dateMon, 30 Mar 2015 18:32:55 +0000
treeherdermozilla-beta@4df54044d9ef [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersWaldo
bugs1129757
milestone38.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1129757 - Improve parse-mega-huge-array.js test performance. r=Waldo
js/src/tests/ecma_5/JSON/parse-mega-huge-array.js
--- a/js/src/tests/ecma_5/JSON/parse-mega-huge-array.js
+++ b/js/src/tests/ecma_5/JSON/parse-mega-huge-array.js
@@ -7,20 +7,20 @@ var BUGNUMBER = 667527;
 var summary = "JSON.parse should parse arrays of essentially unlimited size";
 
 print(BUGNUMBER + ": " + summary);
 
 /**************
  * BEGIN TEST *
  **************/
 
-var str = '[';
-for (var i = 0, sz = Math.pow(2, 21); i < sz; i++)
-  str += '0,';
-str += '0]';
+var body = "0,";
+for (var i = 0; i < 21; i++)
+  body = body + body;
+var str = '[' + body + '0]';
 
 var arr = JSON.parse(str);
 assertEq(arr.length, Math.pow(2, 21) + 1);
 
 /******************************************************************************/
 
 if (typeof reportCompare === "function")
   reportCompare(true, true);