Commit 19ffed65 authored by agrieve's avatar agrieve Committed by Commit Bot

Add js-perf-test to exercise v8_inspector::String16

BUG=chromium:738469

Review-Url: https://codereview.chromium.org/2962213002
Cr-Commit-Position: refs/heads/master@{#46612}
parent ea632716
......@@ -2,23 +2,24 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
new BenchmarkSuite('Debugger.paused', [10000], [
new Benchmark('Debugger.paused', false, false, 0, DebuggerPaused, DebuggerEnable, DebuggerDisable),
]);
(function() {
new BenchmarkSuite('Debugger.paused', [10000], [
new Benchmark('Debugger.paused', false, false, 0, DebuggerPaused, Setup, TearDown),
]);
let lastId = 0;
function DebuggerEnable() {
send(JSON.stringify({id: ++lastId, method: 'Debugger.enable'}));
// force lazy compilation of inspector related scrtips
send(JSON.stringify({id: ++lastId, method: 'Runtime.evaluate', params: {expression: ''}}));
}
function Setup() {
SendMessage('Debugger.enable');
// Force lazy compilation of inspector related scripts.
SendMessage('Runtime.evaluate', {expression: ''});
}
function DebuggerDisable() {
send(JSON.stringify({id: ++lastId, method: 'Debugger.disable'}));
}
function TearDown() {
SendMessage('Debugger.disable');
}
function DebuggerPaused() {
for (var i = 0; i < 10; ++i) {
debugger;
function DebuggerPaused() {
for (var i = 0; i < 10; ++i) {
debugger;
}
}
}
})();
......@@ -5,8 +5,10 @@
load('../base.js');
load('debugger.js');
load('runtime.js');
var success = true;
let success = true;
let lastId = 0;
function PrintResult(name, result) {
print(name + '-Inspector(Score): ' + result);
......@@ -26,3 +28,11 @@ BenchmarkSuite.config.doDeterministic = undefined;
BenchmarkSuite.RunSuites({ NotifyResult: PrintResult,
NotifyError: PrintError,
NotifyStep: PrintStep });
function SendMessage(method, params) {
let obj = {id: ++lastId, method: method};
if (params) {
obj.params = params;
}
send(JSON.stringify(obj));
}
// 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.
(function() {
new BenchmarkSuite('Runtime.evaluate(String16Cstor)', [1000], [
new Benchmark('Runtime.evaluate(String16Cstor)', false, false, 0, EvaluateTest, Setup, TearDown),
]);
function Setup() {
// Force lazy compilation of inspector related scripts.
SendMessage('Runtime.evaluate', {expression: ''});
}
function TearDown() {
}
function EvaluateTest() {
// This is meant to exercise the overhead of v8_inspector::String16
// constructors. https://crbug.com/738469
for (var i = 0; i < 10; ++i) {
SendMessage('Runtime.evaluate', {expression: '({})', returnByValue: true});
}
}
})();
......@@ -550,11 +550,12 @@
"name": "Inspector",
"path": ["Inspector"],
"main": "run.js",
"resources": [ "debugger.js" ],
"resources": [ "debugger.js", "runtime.js" ],
"flags": ["--enable-inspector"],
"results_regexp": "^%s\\-Inspector\\(Score\\): (.+)$",
"tests": [
{"name": "Debugger.paused"}
{"name": "Debugger.paused"},
{"name": "Runtime.evaluate(String16Cstor)"}
]
}
]
......
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