Skip to content

Commit

Permalink
benchmarking: fix runtime regression for require.cache (#257)
Browse files Browse the repository at this point in the history
Reported regression was due to underlying runner.runBenchmarks()
function. Workaround is to revert the order of functions require.new
and require.cache.

PR-URL: nodejs/benchmarking#257
Fixes: nodejs/benchmarking#202
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
  • Loading branch information
uttampawar authored and mhdawson committed Jan 22, 2019
1 parent b78864a commit 069619d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions experimental/benchmarks/node-api/require/require.perf.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ if (module === require.main) {
}

function runBenchmarks(count) {
runner.runBenchmarks('require.new', function(suite) {
runner.buildNTests(count, 'require.new', suite, newRequire);
});
runner.runBenchmarks('require.cached', function(suite) {
runner.buildNTests(count, 'require.cached', suite, cachedRequire);
});
runner.runBenchmarks('require.new', function(suite) {
runner.buildNTests(count, 'require.new', suite, newRequire);
});
}

module.exports = runBenchmarks;
Expand Down

0 comments on commit 069619d

Please sign in to comment.