Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Benchmark fixes #9064

Closed
wants to merge 3 commits into from
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 4 additions & 1 deletion benchmark/common.js
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
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
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