Chromium Code Reviews| Index: test/js-perf-test/Inspector/runtime.js |
| diff --git a/test/js-perf-test/Inspector/runtime.js b/test/js-perf-test/Inspector/runtime.js |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..5f6f8009653bbce830bcc12fbdc0a9996d93be81 |
| --- /dev/null |
| +++ b/test/js-perf-test/Inspector/runtime.js |
| @@ -0,0 +1,26 @@ |
| +// 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', [1000], [ |
| + new Benchmark('Runtime.evaluate', false, false, 0, EvaluateTest, Setup, TearDown), |
| + ]); |
| + |
| + function Setup() { |
| + SendMessage('Debugger.enable'); |
|
kozy
2017/07/06 21:18:32
You don't need to enable Debugger to run Runtime.e
agrieve
2017/07/07 18:34:49
Done.
|
| + } |
| + |
| + function TearDown() { |
| + SendMessage('Debugger.disable'); |
| + } |
| + |
| + function EvaluateTest() { |
| + for (var i = 0; i < 10; ++i) { |
| + let result = SendMessage('Runtime.evaluate', {expression: '"foo"'}); |
|
kozy
2017/07/06 21:18:32
I was experimenting with callgrind and tried to ma
agrieve
2017/07/07 18:34:49
Done.
|
| + if (result.result.result.value != 'foo') { |
| + throw new Error('eval response was: ' + JSON.stringify(result.result)); |
| + } |
| + } |
| + } |
| +})(); |