diff --git a/benchmark/common.js b/benchmark/common.js index 495d6fdf365871..94f11a2be96933 100644 --- a/benchmark/common.js +++ b/benchmark/common.js @@ -208,11 +208,14 @@ Benchmark.prototype.report = function(rate, elapsed) { }); }; -exports.v8ForceOptimization = function(method, ...args) { +exports.v8ForceOptimization = function(method) { if (typeof method !== 'function') return; + const v8 = require('v8'); v8.setFlagsFromString('--allow_natives_syntax'); + + const args = Array.prototype.slice.call(arguments, 1); method.apply(null, args); eval('%OptimizeFunctionOnNextCall(method)'); method.apply(null, args); diff --git a/benchmark/compare.R b/benchmark/compare.R index 1200340f329837..b4316ca7f81600 100644 --- a/benchmark/compare.R +++ b/benchmark/compare.R @@ -16,8 +16,12 @@ if (!is.null(args.options$help) || plot.filename = args.options$plot; -dat = read.csv(file('stdin')); +dat = read.csv( + file('stdin'), + colClasses=c('character', 'character', 'character', 'numeric', 'numeric') +); dat = data.frame(dat); + dat$nameTwoLines = paste0(dat$filename, '\n', dat$configuration); dat$name = paste0(dat$filename, dat$configuration); diff --git a/benchmark/compare.js b/benchmark/compare.js index de328d60fcbae0..ea431b18cb4cd9 100644 --- a/benchmark/compare.js +++ b/benchmark/compare.js @@ -40,8 +40,8 @@ if (benchmarks.length === 0) { // Create queue from the benchmarks list such both node versions are tested // `runs` amount of times each. const queue = []; -for (let iter = 0; iter < runs; iter++) { - for (const filename of benchmarks) { +for (const filename of benchmarks) { + for (let iter = 0; iter < runs; iter++) { for (const binary of binaries) { queue.push({ binary, filename, iter }); }