[Test] Add TypedArray constructor benchmarks.
Add a simple benchmark for a TypedArray constructor. Run once with the default pipeline and once with turbofan so that we can compare the performance. Also fixes a typo in the Regex for the result of the CopyWithin benchmark which stopped the results showing up in the perf dashboard. BUG= Change-Id: Ic2eb0bd1e02b458c1163e97130abd0e7531c2e1c Reviewed-on: https://chromium-review.googlesource.com/440225 Reviewed-by: Benedikt Meurer <bmeurer@chromium.org> Commit-Queue: Peter Marshall <petermarshall@chromium.org> Cr-Commit-Position: refs/heads/master@{#43087}
This commit is contained in:
parent
82e43bfed8
commit
88df7dcaf4
@ -278,13 +278,25 @@
|
||||
{
|
||||
"name": "TypedArrays",
|
||||
"path": ["TypedArrays"],
|
||||
"main": "run.js",
|
||||
"resources": [
|
||||
"typedarrays.js"
|
||||
],
|
||||
"results_regexp": "^TypedArrays\\-%s\\(Scope\\): (.+)$",
|
||||
"results_regexp": "^TypedArrays\\-%s\\(Score\\): (.+)$",
|
||||
"tests": [
|
||||
{"name": "CopyWithin"}
|
||||
{
|
||||
"name": "CopyWithin",
|
||||
"main": "run.js",
|
||||
"test_flags": ["typedarrays"]
|
||||
},
|
||||
{
|
||||
"name": "Constructor",
|
||||
"main": "run.js",
|
||||
"test_flags": ["constructor"]
|
||||
},
|
||||
{
|
||||
"name": "Constructor--Future",
|
||||
"flags": ["--future"],
|
||||
"results_regexp": "^TypedArrays\\-Constructor\\(Score\\): (.+)$",
|
||||
"main": "run.js",
|
||||
"test_flags": ["constructor"]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
|
11
test/js-perf-test/TypedArrays/constructor.js
Normal file
11
test/js-perf-test/TypedArrays/constructor.js
Normal file
@ -0,0 +1,11 @@
|
||||
// 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.
|
||||
|
||||
new BenchmarkSuite('Constructor', [1000], [
|
||||
new Benchmark('Constructor', false, false, 0, constructor),
|
||||
]);
|
||||
|
||||
function constructor() {
|
||||
new Int32Array(16);
|
||||
}
|
@ -2,10 +2,8 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
|
||||
load('../base.js');
|
||||
load('typedarrays.js');
|
||||
|
||||
load(arguments[0] + '.js');
|
||||
|
||||
var success = true;
|
||||
|
||||
@ -13,7 +11,6 @@ function PrintResult(name, result) {
|
||||
print(`TypedArrays-${name}(Score): ${result}`);
|
||||
}
|
||||
|
||||
|
||||
function PrintError(name, error) {
|
||||
PrintResult(name, error);
|
||||
success = false;
|
||||
|
Loading…
Reference in New Issue
Block a user