Skip to content

Commit 2f13fc1

Browse files
jasnellevanlucas
authored andcommitted
benchmark: add benchmark for v8.getHeap*Statistics
PR-URL: #12681 Reviewed-By: Vse Mozhet Byt <[email protected]>
1 parent cb06c8c commit 2f13fc1

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

benchmark/v8/get-stats.js

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
'use strict';
2+
3+
const common = require('../common.js');
4+
const v8 = require('v8');
5+
6+
const bench = common.createBenchmark(main, {
7+
method: [
8+
'getHeapStatistics',
9+
'getHeapSpaceStatistics'
10+
],
11+
n: [1e6],
12+
flags: ['--ignition --turbo', '']
13+
});
14+
15+
function main(conf) {
16+
const n = +conf.n;
17+
const method = conf.method;
18+
var i = 0;
19+
bench.start();
20+
for (; i < n; i++)
21+
v8[method]();
22+
bench.end(n);
23+
}

0 commit comments

Comments
 (0)