Skip to content

Commit

Permalink
benchmark: add benchmark for v8.getHeap*Statistics
Browse files Browse the repository at this point in the history
PR-URL: #12681
Reviewed-By: Vse Mozhet Byt <[email protected]>
  • Loading branch information
jasnell committed Apr 28, 2017
1 parent deb9622 commit bed4612
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions benchmark/v8/get-stats.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
'use strict';

const common = require('../common.js');
const v8 = require('v8');

const bench = common.createBenchmark(main, {
method: [
'getHeapStatistics',
'getHeapSpaceStatistics'
],
n: [1e6],
flags: ['--ignition --turbo', '']
});

function main(conf) {
const n = +conf.n;
const method = conf.method;
var i = 0;
bench.start();
for (; i < n; i++)
v8[method]();
bench.end(n);
}

0 comments on commit bed4612

Please sign in to comment.