v8/test/js-perf-test/ApiAccessors/accessor.js
Sathya Gunasekaran 196a527504 [api] Add benchmark for api accessors
Bug: v8:11321
Change-Id: I330fb8ee7d915f99f9b82f7187be40ac33043f62
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2883625
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77340}
2021-10-12 10:44:52 +00:00

15 lines
381 B
JavaScript

// 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, ()=>{});