Permalink
Browse files

benchmark: add --expose_internals switch

Adds --expose_internals switch to benchmark runner. This makes
misc/freelist.js benchmark run properly

Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Andreas Madsen <amwebdk@gmail.com>
PR-URL: #8547
  • Loading branch information...
bzoz authored and jasnell committed Sep 16, 2016
1 parent e97fe46 commit 84481f9157f193348040ab5e128efcd0a85ced4f
Showing with 6 additions and 2 deletions.
  1. +2 −1 benchmark/common.js
  2. +4 −1 benchmark/misc/freelist.js
@@ -137,7 +137,8 @@ Benchmark.prototype._run = function() {
}
const child = child_process.fork(require.main.filename, childArgs, {
env: childEnv
env: childEnv,
execArgv: ['--expose_internals'].concat(process.execArgv)
});
child.on('message', sendResult);
child.on('close', function(code) {
@@ -1,13 +1,16 @@
'use strict';
var common = require('../common.js');
var FreeList = require('internal/freelist').FreeList;
var bench = common.createBenchmark(main, {
n: [100000]
});
function main(conf) {
// Using internal/freelist requires node to be run with --expose_internals
// switch. common.js will do that when calling main(), so we require
// this module here
const FreeList = require('internal/freelist').FreeList;
var n = conf.n;
var poolSize = 1000;
var list = new FreeList('test', poolSize, Object);

0 comments on commit 84481f9

Please sign in to comment.