OLD | NEW |
1 // Copyright 2017 the V8 project authors. All rights reserved. | 1 // Copyright 2017 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 new BenchmarkSuite('Debugger.paused', [10000], [ | 5 (function() { |
6 new Benchmark('Debugger.paused', false, false, 0, DebuggerPaused, DebuggerEnab
le, DebuggerDisable), | 6 new BenchmarkSuite('Debugger.paused', [10000], [ |
7 ]); | 7 new Benchmark('Debugger.paused', false, false, 0, DebuggerPaused, Setup, Tea
rDown), |
| 8 ]); |
8 | 9 |
9 let lastId = 0; | 10 function Setup() { |
10 function DebuggerEnable() { | 11 SendMessage('Debugger.enable'); |
11 send(JSON.stringify({id: ++lastId, method: 'Debugger.enable'})); | 12 // Force lazy compilation of inspector related scripts. |
12 // force lazy compilation of inspector related scrtips | 13 SendMessage('Runtime.evaluate', {expression: ''}); |
13 send(JSON.stringify({id: ++lastId, method: 'Runtime.evaluate', params: {expres
sion: ''}})); | 14 } |
14 } | |
15 | 15 |
16 function DebuggerDisable() { | 16 function TearDown() { |
17 send(JSON.stringify({id: ++lastId, method: 'Debugger.disable'})); | 17 SendMessage('Debugger.disable'); |
18 } | 18 } |
19 | 19 |
20 function DebuggerPaused() { | 20 function DebuggerPaused() { |
21 for (var i = 0; i < 10; ++i) { | 21 for (var i = 0; i < 10; ++i) { |
22 debugger; | 22 debugger; |
| 23 } |
23 } | 24 } |
24 } | 25 })(); |
OLD | NEW |