Commit aff557b6 authored by Z Nguyen-Huu's avatar Z Nguyen-Huu Committed by Commit Bot

add micro-benchmark of Array.map for frozen objects

Bug: v8:6831
Change-Id: I79cd1e25ddca17f0d5026bee737cd3fde0041e85
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1653733
Commit-Queue: Z Nguyen-Huu <duongn@microsoft.com>
Reviewed-by: 's avatarBenedikt Meurer <bmeurer@chromium.org>
Reviewed-by: 's avatarToon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62124}
parent 3834c637
......@@ -582,7 +582,8 @@
{"name": "ApplySpreadLiteral"},
{"name": "SpreadCall"},
{"name": "SpreadCallSpreadLiteral"},
{"name": "HasOwnProperty"}
{"name": "HasOwnProperty"},
{"name": "ArrayMap"}
]
},
{
......
// Copyright 2019 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.
function setupArrayMap(length) {
var a = new Array(length);
for (var i=0;i<length;i++) {
a[i] = ''+i;
}
return Object.freeze(a);
}
const frozenArrayMap = setupArrayMap(200);
function driverArrayMap(n) {
let result = 0;
for (var i=0;i<n;i++) {
result = frozenArrayMap.map(Number);
}
return result;
}
function ArrayMap() {
driverArrayMap(1e3);
}
function ArrayMapWarmUp() {
driverArrayMap(1e1);
driverArrayMap(1e2);
}
createSuite('ArrayMap', 10, ArrayMap, ArrayMapWarmUp);
......@@ -6,6 +6,7 @@ load('tagged-template.js');
load('array-indexof-includes.js');
load('spread-call.js');
load('has-own-property.js');
load('array-map.js');
function PrintResult(name, result) {
console.log(name);
......
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