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 <vsemozhetbyt@gmail.com>
  • Loading branch information
jasnell authored and evanlucas committed May 3, 2017
1 parent 395380a commit 373e9f0
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 373e9f0

Please sign in to comment.