Commit 45dfd76a authored by Peter Marshall's avatar Peter Marshall Committed by Commit Bot

[Test] Add perf tests for TypedArray constructors.

Adds a perf test for constructing a TypedArray from a regular array,
and from a pre-made ArrayBuffer. Runs both new tests with default and
future configurations for comparison.

BUG=v8:5977

Change-Id: Idd132ca879702c54b2947a0e57ed8fe782f2767f
Reviewed-on: https://chromium-review.googlesource.com/446342Reviewed-by: 's avatarBenedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#43412}
parent 6b5ab923
......@@ -297,6 +297,30 @@
"main": "run.js",
"test_flags": ["constructor"]
},
{
"name": "ConstructWithBuffer",
"main": "run.js",
"test_flags": ["construct-buffer"]
},
{
"name": "ConstructWithBuffer--Future",
"flags": ["--future"],
"results_regexp": "^TypedArrays\\-ConstructWithBuffer\\(Score\\): (.+)$",
"main": "run.js",
"test_flags": ["construct-buffer"]
},
{
"name": "ConstructArrayLike",
"main": "run.js",
"test_flags": ["construct-arraylike"]
},
{
"name": "ConstructArrayLike--Future",
"flags": ["--future"],
"results_regexp": "^TypedArrays\\-ConstructArrayLike\\(Score\\): (.+)$",
"main": "run.js",
"test_flags": ["construct-arraylike"]
},
{
"name": "Sort",
"main": "run.js",
......
// 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('ConstructArrayLike', [1000], [
new Benchmark('ConstructArrayLike', false, false, 0, constructor),
]);
var arr = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16];
function constructor() {
new Int32Array(arr);
}
// 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('ConstructWithBuffer', [1000], [
new Benchmark('ConstructWithBuffer', false, false, 0, constructor),
]);
var buffer = new ArrayBuffer(64);
function constructor() {
new Int32Array(buffer);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment