Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion benchmark/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
6 changes: 5 additions & 1 deletion benchmark/compare.R
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
4 changes: 2 additions & 2 deletions benchmark/compare.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 });
}
Expand Down