Commit 196a5275 authored by Sathya Gunasekaran's avatar Sathya Gunasekaran Committed by V8 LUCI CQ

[api] Add benchmark for api accessors

Bug: v8:11321
Change-Id: I330fb8ee7d915f99f9b82f7187be40ac33043f62
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2883625Reviewed-by: 's avatarCamillo Bruni <cbruni@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77340}
parent f19ee5e0
// 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 LoadNodeType() {
let node = new d8.dom.Div();
let result = 0;
for (var i = 0; i < 10e5; i++) {
result += node.nodeType;
}
return result;
}
createSuite('nodeType', 1, LoadNodeType, ()=>{});
// 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.
load('../base.js');
load('accessor.js');
function PrintResult(name, result) {
console.log(name + '-ApiAccessors(Score): ' + result);
}
function PrintError(name, error) {
PrintResult(name, error);
}
BenchmarkSuite.config.doWarmup = undefined;
BenchmarkSuite.config.doDeterministic = undefined;
BenchmarkSuite.RunSuites({ NotifyResult: PrintResult,
NotifyError: PrintError });
......@@ -509,6 +509,17 @@
{"name": "NewIntlLocaleWithOptions"}
]
},
{
"name": "ApiAccessors",
"path": ["ApiAccessors"],
"main": "run.js",
"resources": [ "accessor.js" ],
"flags": [],
"results_regexp": "^%s\\-ApiAccessors\\(Score\\): (.+)$",
"tests": [
{"name": "nodeType"}
]
},
{
"name": "Inspector",
"path": ["Inspector"],
......
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