From b69b24a2a247c8316bb214f6f3ef947f3ea302ac Mon Sep 17 00:00:00 2001 From: petermarshall Date: Mon, 6 Feb 2017 02:19:24 -0800 Subject: [PATCH] [Test] Update all SixSpeed tests to run in separate processes. BUG=v8:5922 Review-Url: https://codereview.chromium.org/2674873002 Cr-Commit-Position: refs/heads/master@{#42954} --- test/js-perf-test/SixSpeed.json | 71 ++++++++++-------- .../array_destructuring.js | 38 ---------- .../SixSpeed/array_destructuring/es5.js | 17 +++++ .../SixSpeed/array_destructuring/es6.js | 17 +++++ .../SixSpeed/array_destructuring/run.js | 25 ------- .../SixSpeed/object_literals/es5.js | 18 +++++ .../SixSpeed/object_literals/es6.js | 19 +++++ .../object_literals/object_literals.js | 41 ----------- .../SixSpeed/object_literals/run.js | 25 ------- .../SixSpeed/{super_spread => }/run.js | 2 +- test/js-perf-test/SixSpeed/spread/babel.js | 15 ++++ test/js-perf-test/SixSpeed/spread/es5.js | 15 ++++ test/js-perf-test/SixSpeed/spread/es6.js | 15 ++++ test/js-perf-test/SixSpeed/spread/run.js | 25 ------- test/js-perf-test/SixSpeed/spread/spread.js | 73 ------------------- 15 files changed, 159 insertions(+), 257 deletions(-) delete mode 100644 test/js-perf-test/SixSpeed/array_destructuring/array_destructuring.js create mode 100644 test/js-perf-test/SixSpeed/array_destructuring/es5.js create mode 100644 test/js-perf-test/SixSpeed/array_destructuring/es6.js delete mode 100644 test/js-perf-test/SixSpeed/array_destructuring/run.js create mode 100644 test/js-perf-test/SixSpeed/object_literals/es5.js create mode 100644 test/js-perf-test/SixSpeed/object_literals/es6.js delete mode 100644 test/js-perf-test/SixSpeed/object_literals/object_literals.js delete mode 100644 test/js-perf-test/SixSpeed/object_literals/run.js rename test/js-perf-test/SixSpeed/{super_spread => }/run.js (96%) create mode 100644 test/js-perf-test/SixSpeed/spread/babel.js create mode 100644 test/js-perf-test/SixSpeed/spread/es5.js create mode 100644 test/js-perf-test/SixSpeed/spread/es6.js delete mode 100644 test/js-perf-test/SixSpeed/spread/run.js delete mode 100644 test/js-perf-test/SixSpeed/spread/spread.js diff --git a/test/js-perf-test/SixSpeed.json b/test/js-perf-test/SixSpeed.json index 746db951f0..3578ef3cfa 100644 --- a/test/js-perf-test/SixSpeed.json +++ b/test/js-perf-test/SixSpeed.json @@ -10,30 +10,36 @@ "tests": [ { "name": "Array pattern destructuring", - "path": ["SixSpeed/array_destructuring"], - "main": "run.js", - "resources": [ - "run.js", - "array_destructuring.js" - ], + "path": ["SixSpeed"], "results_regexp": "^%s\\(Score\\): (.+)$", "tests": [ - {"name": "ArrayDestructuring-ES5"}, - {"name": "ArrayDestructuring-ES6"} + { + "name": "ES5", + "main": "run.js", + "test_flags": ["array_destructuring/es5"] + }, + { + "name": "ES6", + "main": "run.js", + "test_flags": ["array_destructuring/es6"] + } ] }, { "name": "Computed property names in object literals", - "path": ["SixSpeed/object_literals"], - "main": "run.js", - "resources": [ - "run.js", - "object_literals.js" - ], + "path": ["SixSpeed"], "results_regexp": "^%s\\(Score\\): (.+)$", "tests": [ - {"name": "ObjectLiterals-ES5"}, - {"name": "ObjectLiterals-ES6"} + { + "name": "ES5", + "main": "run.js", + "test_flags": ["object_literals/es5"] + }, + { + "name": "ES6", + "main": "run.js", + "test_flags": ["object_literals/es6"] + } ] }, { @@ -52,39 +58,46 @@ }, { "name": "Spread", - "path": ["SixSpeed/spread"], - "main": "run.js", - "resources": [ - "run.js", - "spread.js" - ], + "path": ["SixSpeed"], "results_regexp": "^%s\\(Score\\): (.+)$", "tests": [ - {"name": "Spread-ES5"}, - {"name": "Spread-Traceur"}, - {"name": "Spread-ES6"} + { + "name": "ES5", + "main": "run.js", + "test_flags": ["spread/es5"] + }, + { + "name": "Babel", + "main": "run.js", + "test_flags": ["spread/babel"] + }, + { + "name": "ES6", + "main": "run.js", + "test_flags": ["spread/es6"] + } ] }, { "name": "SuperSpread", - "path": ["SixSpeed/super_spread"], + "path": ["SixSpeed"], "flags": ["--future"], "results_regexp": "^%s\\(Score\\): (.+)$", "tests": [ { "name": "ES5", "main": "run.js", - "test_flags": ["es5"] + "test_flags": ["super_spread/es5"] }, { "name": "Babel", "main": "run.js", - "test_flags": ["babel"] + "test_flags": ["super_spread/babel"] }, { "name": "ES6", "main": "run.js", - "test_flags": ["es6"] + "test_flags": ["super_spread/es6"] } ] } diff --git a/test/js-perf-test/SixSpeed/array_destructuring/array_destructuring.js b/test/js-perf-test/SixSpeed/array_destructuring/array_destructuring.js deleted file mode 100644 index f4a1d53f5c..0000000000 --- a/test/js-perf-test/SixSpeed/array_destructuring/array_destructuring.js +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright 2016 the V8 project authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// This benchmark is based on the six-speed benchmark build output. -// Copyright 2014 Kevin Decker - - -new BenchmarkSuite('ArrayDestructuring-ES5', [1000], [ - new Benchmark('ES5', false, false, 0, ES5), -]); - -new BenchmarkSuite('ArrayDestructuring-ES6', [1000], [ - new Benchmark('ES6', false, false, 0, ES6), -]); - -// ---------------------------------------------------------------------------- -// Benchmark: ES5 -// ---------------------------------------------------------------------------- - -function ES5() { - "use strict"; - var data = [1, 2, 3]; - var c = data[0]; - return c; -} - - -// ---------------------------------------------------------------------------- -// Benchmark: ES6 -// ---------------------------------------------------------------------------- - -function ES6() { - "use strict"; - var data = [1, 2, 3]; - var [c] = data; - return c; -} diff --git a/test/js-perf-test/SixSpeed/array_destructuring/es5.js b/test/js-perf-test/SixSpeed/array_destructuring/es5.js new file mode 100644 index 0000000000..e95144d02f --- /dev/null +++ b/test/js-perf-test/SixSpeed/array_destructuring/es5.js @@ -0,0 +1,17 @@ +// Copyright 2017 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// This benchmark is based on the six-speed benchmark build output. +// Copyright 2014 Kevin Decker + +new BenchmarkSuite('ES5', [1000], [ + new Benchmark('ES5', false, false, 0, ES5), +]); + +function ES5() { + "use strict"; + var data = [1, 2, 3]; + var c = data[0]; + return c; +} diff --git a/test/js-perf-test/SixSpeed/array_destructuring/es6.js b/test/js-perf-test/SixSpeed/array_destructuring/es6.js new file mode 100644 index 0000000000..2ff0c9baab --- /dev/null +++ b/test/js-perf-test/SixSpeed/array_destructuring/es6.js @@ -0,0 +1,17 @@ +// Copyright 2017 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// This benchmark is based on the six-speed benchmark build output. +// Copyright 2014 Kevin Decker + +new BenchmarkSuite('ES6', [1000], [ + new Benchmark('ES6', false, false, 0, ES6), +]); + +function ES6() { + "use strict"; + var data = [1, 2, 3]; + var [c] = data; + return c; +} diff --git a/test/js-perf-test/SixSpeed/array_destructuring/run.js b/test/js-perf-test/SixSpeed/array_destructuring/run.js deleted file mode 100644 index 5988512619..0000000000 --- a/test/js-perf-test/SixSpeed/array_destructuring/run.js +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2016 the V8 project authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -load('../../base.js'); -load('array_destructuring.js'); - -var success = true; - -function PrintResult(name, result) { - print(name + '(Score): ' + result); -} - - -function PrintError(name, error) { - PrintResult(name, error); - success = false; -} - - -BenchmarkSuite.config.doWarmup = undefined; -BenchmarkSuite.config.doDeterministic = undefined; - -BenchmarkSuite.RunSuites({ NotifyResult: PrintResult, - NotifyError: PrintError }); diff --git a/test/js-perf-test/SixSpeed/object_literals/es5.js b/test/js-perf-test/SixSpeed/object_literals/es5.js new file mode 100644 index 0000000000..39155de484 --- /dev/null +++ b/test/js-perf-test/SixSpeed/object_literals/es5.js @@ -0,0 +1,18 @@ +// Copyright 2017 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// This benchmark is based on the six-speed benchmark build output. +// Copyright 2014 Kevin Decker + +new BenchmarkSuite('ES5', [1000], [ + new Benchmark('ES5', false, false, 0, ES5), +]); + +function ES5() { + "use strict"; + var name = 'foo'; + var ret = {}; + ret[name] = 'bar'; + return ret; +} diff --git a/test/js-perf-test/SixSpeed/object_literals/es6.js b/test/js-perf-test/SixSpeed/object_literals/es6.js new file mode 100644 index 0000000000..09311f24f8 --- /dev/null +++ b/test/js-perf-test/SixSpeed/object_literals/es6.js @@ -0,0 +1,19 @@ +// Copyright 2017 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// This benchmark is based on the six-speed benchmark build output. +// Copyright 2014 Kevin Decker + +new BenchmarkSuite('ES6', [1000], [ + new Benchmark('ES6', false, false, 0, ES6), +]); + +function ES6() { + "use strict"; + var name = 'foo'; + var ret = { + [name]: 'bar', + }; + return ret; +} diff --git a/test/js-perf-test/SixSpeed/object_literals/object_literals.js b/test/js-perf-test/SixSpeed/object_literals/object_literals.js deleted file mode 100644 index 831e173ec2..0000000000 --- a/test/js-perf-test/SixSpeed/object_literals/object_literals.js +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2016 the V8 project authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// This benchmark is based on the six-speed benchmark build output. -// Copyright 2014 Kevin Decker - - -new BenchmarkSuite('ObjectLiterals-ES5', [1000], [ - new Benchmark('ES5', false, false, 0, ES5), -]); - -new BenchmarkSuite('ObjectLiterals-ES6', [1000], [ - new Benchmark('ES6', false, false, 0, ES6), -]); - -// ---------------------------------------------------------------------------- -// Benchmark: ES5 -// ---------------------------------------------------------------------------- - -function ES5() { - "use strict"; - var name = 'foo'; - var ret = {}; - ret[name] = 'bar'; - return ret; -} - - -// ---------------------------------------------------------------------------- -// Benchmark: ES6 -// ---------------------------------------------------------------------------- - -function ES6() { - "use strict"; - var name = 'foo'; - var ret = { - [name]: 'bar', - }; - return ret; -} diff --git a/test/js-perf-test/SixSpeed/object_literals/run.js b/test/js-perf-test/SixSpeed/object_literals/run.js deleted file mode 100644 index f8b5343f9e..0000000000 --- a/test/js-perf-test/SixSpeed/object_literals/run.js +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2016 the V8 project authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -load('../../base.js'); -load('object_literals.js'); - -var success = true; - -function PrintResult(name, result) { - print(name + '(Score): ' + result); -} - - -function PrintError(name, error) { - PrintResult(name, error); - success = false; -} - - -BenchmarkSuite.config.doWarmup = undefined; -BenchmarkSuite.config.doDeterministic = undefined; - -BenchmarkSuite.RunSuites({ NotifyResult: PrintResult, - NotifyError: PrintError }); diff --git a/test/js-perf-test/SixSpeed/super_spread/run.js b/test/js-perf-test/SixSpeed/run.js similarity index 96% rename from test/js-perf-test/SixSpeed/super_spread/run.js rename to test/js-perf-test/SixSpeed/run.js index 3025caf8a8..272d42fa9a 100644 --- a/test/js-perf-test/SixSpeed/super_spread/run.js +++ b/test/js-perf-test/SixSpeed/run.js @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -load('../../base.js'); +load('../base.js'); load(arguments[0] + '.js'); var success = true; diff --git a/test/js-perf-test/SixSpeed/spread/babel.js b/test/js-perf-test/SixSpeed/spread/babel.js new file mode 100644 index 0000000000..89beae3270 --- /dev/null +++ b/test/js-perf-test/SixSpeed/spread/babel.js @@ -0,0 +1,15 @@ +// Copyright 2017 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// This benchmark is based on the six-speed benchmark build output. +// Copyright 2014 Kevin Decker + +new BenchmarkSuite('Babel', [1000], [ + new Benchmark('Babel', false, false, 0, Babel), +]); + +function Babel() { + "use strict"; + return Math.max.apply(Math, [1, 2, 3]); +} diff --git a/test/js-perf-test/SixSpeed/spread/es5.js b/test/js-perf-test/SixSpeed/spread/es5.js new file mode 100644 index 0000000000..8cc0e74488 --- /dev/null +++ b/test/js-perf-test/SixSpeed/spread/es5.js @@ -0,0 +1,15 @@ +// Copyright 2017 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// This benchmark is based on the six-speed benchmark build output. +// Copyright 2014 Kevin Decker + +new BenchmarkSuite('ES5', [1000], [ + new Benchmark('ES5', false, false, 0, ES5), +]); + +function ES5() { + "use strict"; + return Math.max.apply(Math, [1, 2, 3]); +} diff --git a/test/js-perf-test/SixSpeed/spread/es6.js b/test/js-perf-test/SixSpeed/spread/es6.js new file mode 100644 index 0000000000..6a2f1e861c --- /dev/null +++ b/test/js-perf-test/SixSpeed/spread/es6.js @@ -0,0 +1,15 @@ +// Copyright 2017 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// This benchmark is based on the six-speed benchmark build output. +// Copyright 2014 Kevin Decker + +new BenchmarkSuite('ES6', [1000], [ + new Benchmark('ES6', false, false, 0, ES6), +]); + +function ES6() { + "use strict"; + return Math.max(...[1, 2, 3]); +} diff --git a/test/js-perf-test/SixSpeed/spread/run.js b/test/js-perf-test/SixSpeed/spread/run.js deleted file mode 100644 index c46b29be98..0000000000 --- a/test/js-perf-test/SixSpeed/spread/run.js +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2016 the V8 project authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -load('../../base.js'); -load('spread.js'); - -var success = true; - -function PrintResult(name, result) { - print(name + '(Score): ' + result); -} - - -function PrintError(name, error) { - PrintResult(name, error); - success = false; -} - - -BenchmarkSuite.config.doWarmup = undefined; -BenchmarkSuite.config.doDeterministic = undefined; - -BenchmarkSuite.RunSuites({ NotifyResult: PrintResult, - NotifyError: PrintError }); diff --git a/test/js-perf-test/SixSpeed/spread/spread.js b/test/js-perf-test/SixSpeed/spread/spread.js deleted file mode 100644 index 7c5f40b427..0000000000 --- a/test/js-perf-test/SixSpeed/spread/spread.js +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright 2016 the V8 project authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// This benchmark is based on the six-speed benchmark build output. -// Copyright 2014 Kevin Decker - - -new BenchmarkSuite('Spread-ES5', [1000], [ - new Benchmark('ES5', false, false, 0, ES5), -]); - -new BenchmarkSuite('Spread-Traceur', [1000], [ - new Benchmark('Traceur', false, false, 0, Traceur), -]); - -new BenchmarkSuite('Spread-ES6', [1000], [ - new Benchmark('ES6', false, false, 0, ES6), -]); - -// ---------------------------------------------------------------------------- -// Benchmark: ES5 -// ---------------------------------------------------------------------------- - -function ES5() { - "use strict"; - return Math.max.apply(Math, [1,2,3]); -} - -// ---------------------------------------------------------------------------- -// Benchmark: Traceur -// ---------------------------------------------------------------------------- - -function checkObjectCoercible(v) { - "use strict"; - if (v === null || v === undefined) { - throw new $TypeError('Value cannot be converted to an Object'); - } - return v; -} - -function spread() { - "use strict"; - var rv = [], - j = 0, - iterResult; - for (var i = 0; i < arguments.length; i++) { - var valueToSpread = checkObjectCoercible(arguments[i]); - if (typeof valueToSpread[Symbol.iterator] !== 'function') { - throw new TypeError('Cannot spread non-iterable object.'); - } - var iter = valueToSpread[Symbol.iterator](); - while (!(iterResult = iter.next()).done) { - rv[j++] = iterResult.value; - } - } - return rv; -} - -function Traceur() { - "use strict"; - var $__0; - return ($__0 = Math).max.apply($__0, spread([1, 2, 3])); -} - -// ---------------------------------------------------------------------------- -// Benchmark: ES6 -// ---------------------------------------------------------------------------- - -function ES6() { - "use strict"; - return Math.max(...[1,2,3]); -}