Permalink
Browse files

benchmark: remove forced optimization from path

This removes all instances of %OptimizeFunctionOnNextCall from path
benchmarks

PR-URL: #9615
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
  • Loading branch information...
bzoz committed Mar 1, 2017
1 parent 7587a11 commit eba2c62bb10fb65785050600212f70d38f1ffba3
@@ -1,7 +1,6 @@
'use strict';
var common = require('../common.js');
var path = require('path');
var v8 = require('v8');
var bench = common.createBenchmark(main, {
pathext: [
@@ -30,12 +29,6 @@ function main(conf) {
input = input.slice(0, extIdx);
}
// Force optimization before starting the benchmark
p.basename(input, ext);
v8.setFlagsFromString('--allow_natives_syntax');
eval('%OptimizeFunctionOnNextCall(p.basename)');
p.basename(input, ext);
bench.start();
for (var i = 0; i < n; i++) {
p.basename(input, ext);
@@ -1,7 +1,6 @@
'use strict';
var common = require('../common.js');
var path = require('path');
var v8 = require('v8');
var bench = common.createBenchmark(main, {
pathext: [
@@ -30,12 +29,6 @@ function main(conf) {
input = input.slice(0, extIdx);
}
// Force optimization before starting the benchmark
p.basename(input, ext);
v8.setFlagsFromString('--allow_natives_syntax');
eval('%OptimizeFunctionOnNextCall(p.basename)');
p.basename(input, ext);
bench.start();
for (var i = 0; i < n; i++) {
p.basename(input, ext);
@@ -1,7 +1,6 @@
'use strict';
var common = require('../common.js');
var path = require('path');
var v8 = require('v8');
var bench = common.createBenchmark(main, {
path: [
@@ -21,12 +20,6 @@ function main(conf) {
var p = path.posix;
var input = '' + conf.path;
// Force optimization before starting the benchmark
p.dirname(input);
v8.setFlagsFromString('--allow_natives_syntax');
eval('%OptimizeFunctionOnNextCall(p.dirname)');
p.dirname(input);
bench.start();
for (var i = 0; i < n; i++) {
p.dirname(input);
@@ -1,7 +1,6 @@
'use strict';
var common = require('../common.js');
var path = require('path');
var v8 = require('v8');
var bench = common.createBenchmark(main, {
path: [
@@ -21,12 +20,6 @@ function main(conf) {
var p = path.win32;
var input = '' + conf.path;
// Force optimization before starting the benchmark
p.dirname(input);
v8.setFlagsFromString('--allow_natives_syntax');
eval('%OptimizeFunctionOnNextCall(p.dirname)');
p.dirname(input);
bench.start();
for (var i = 0; i < n; i++) {
p.dirname(input);
@@ -1,7 +1,6 @@
'use strict';
var common = require('../common.js');
var path = require('path');
var v8 = require('v8');
var bench = common.createBenchmark(main, {
path: [
@@ -24,12 +23,6 @@ function main(conf) {
var p = path.posix;
var input = '' + conf.path;
// Force optimization before starting the benchmark
p.extname(input);
v8.setFlagsFromString('--allow_natives_syntax');
eval('%OptimizeFunctionOnNextCall(p.extname)');
p.extname(input);
bench.start();
for (var i = 0; i < n; i++) {
p.extname(input);
@@ -1,7 +1,6 @@
'use strict';
var common = require('../common.js');
var path = require('path');
var v8 = require('v8');
var bench = common.createBenchmark(main, {
path: [
@@ -24,12 +23,6 @@ function main(conf) {
var p = path.win32;
var input = '' + conf.path;
// Force optimization before starting the benchmark
p.extname(input);
v8.setFlagsFromString('--allow_natives_syntax');
eval('%OptimizeFunctionOnNextCall(p.extname)');
p.extname(input);
bench.start();
for (var i = 0; i < n; i++) {
p.extname(input);
@@ -1,7 +1,6 @@
'use strict';
var common = require('../common.js');
var path = require('path');
var v8 = require('v8');
var bench = common.createBenchmark(main, {
props: [
@@ -22,12 +21,6 @@ function main(conf) {
name: props[4] || '',
};
// Force optimization before starting the benchmark
p.format(obj);
v8.setFlagsFromString('--allow_natives_syntax');
eval('%OptimizeFunctionOnNextCall(p.format)');
p.format(obj);
bench.start();
for (var i = 0; i < n; i++) {
p.format(obj);
@@ -1,7 +1,6 @@
'use strict';
var common = require('../common.js');
var path = require('path');
var v8 = require('v8');
var bench = common.createBenchmark(main, {
props: [
@@ -22,12 +21,6 @@ function main(conf) {
name: props[4] || '',
};
// Force optimization before starting the benchmark
p.format(obj);
v8.setFlagsFromString('--allow_natives_syntax');
eval('%OptimizeFunctionOnNextCall(p.format)');
p.format(obj);
bench.start();
for (var i = 0; i < n; i++) {
p.format(obj);
@@ -1,7 +1,6 @@
'use strict';
var common = require('../common.js');
var path = require('path');
var v8 = require('v8');
var bench = common.createBenchmark(main, {
path: [
@@ -19,12 +18,6 @@ function main(conf) {
var p = path.posix;
var input = '' + conf.path;
// Force optimization before starting the benchmark
p.isAbsolute(input);
v8.setFlagsFromString('--allow_natives_syntax');
eval('%OptimizeFunctionOnNextCall(p.isAbsolute)');
p.isAbsolute(input);
bench.start();
for (var i = 0; i < n; i++) {
p.isAbsolute(input);
@@ -1,7 +1,6 @@
'use strict';
var common = require('../common.js');
var path = require('path');
var v8 = require('v8');
var bench = common.createBenchmark(main, {
path: [
@@ -20,12 +19,6 @@ function main(conf) {
var p = path.win32;
var input = '' + conf.path;
// Force optimization before starting the benchmark
p.isAbsolute(input);
v8.setFlagsFromString('--allow_natives_syntax');
eval('%OptimizeFunctionOnNextCall(p.isAbsolute)');
p.isAbsolute(input);
bench.start();
for (var i = 0; i < n; i++) {
p.isAbsolute(input);
@@ -1,7 +1,6 @@
'use strict';
var common = require('../common.js');
var path = require('path');
var v8 = require('v8');
var bench = common.createBenchmark(main, {
paths: [
@@ -15,12 +14,6 @@ function main(conf) {
var p = path.posix;
var args = ('' + conf.paths).split('|');
// Force optimization before starting the benchmark
p.join.apply(null, args);
v8.setFlagsFromString('--allow_natives_syntax');
eval('%OptimizeFunctionOnNextCall(p.join)');
p.join.apply(null, args);
bench.start();
for (var i = 0; i < n; i++) {
p.join.apply(null, args);
@@ -1,7 +1,6 @@
'use strict';
var common = require('../common.js');
var path = require('path');
var v8 = require('v8');
var bench = common.createBenchmark(main, {
paths: [
@@ -15,12 +14,6 @@ function main(conf) {
var p = path.win32;
var args = ('' + conf.paths).split('|');
// Force optimization before starting the benchmark
p.join.apply(null, args);
v8.setFlagsFromString('--allow_natives_syntax');
eval('%OptimizeFunctionOnNextCall(p.join)');
p.join.apply(null, args);
bench.start();
for (var i = 0; i < n; i++) {
p.join.apply(null, args);
@@ -1,7 +1,6 @@
'use strict';
var common = require('../common.js');
var path = require('path');
var v8 = require('v8');
var bench = common.createBenchmark(main, {
path: [
@@ -18,12 +17,6 @@ function main(conf) {
var p = path.win32;
var input = '' + conf.path;
// Force optimization before starting the benchmark
p._makeLong(input);
v8.setFlagsFromString('--allow_natives_syntax');
eval('%OptimizeFunctionOnNextCall(p._makeLong)');
p._makeLong(input);
bench.start();
for (var i = 0; i < n; i++) {
p._makeLong(input);
@@ -1,7 +1,6 @@
'use strict';
var common = require('../common.js');
var path = require('path');
var v8 = require('v8');
var bench = common.createBenchmark(main, {
path: [
@@ -20,12 +19,6 @@ function main(conf) {
var p = path.posix;
var input = '' + conf.path;
// Force optimization before starting the benchmark
p.normalize(input);
v8.setFlagsFromString('--allow_natives_syntax');
eval('%OptimizeFunctionOnNextCall(p.normalize)');
p.normalize(input);
bench.start();
for (var i = 0; i < n; i++) {
p.normalize(input);
@@ -1,7 +1,6 @@
'use strict';
var common = require('../common.js');
var path = require('path');
var v8 = require('v8');
var bench = common.createBenchmark(main, {
path: [
@@ -20,12 +19,6 @@ function main(conf) {
var p = path.win32;
var input = '' + conf.path;
// Force optimization before starting the benchmark
p.normalize(input);
v8.setFlagsFromString('--allow_natives_syntax');
eval('%OptimizeFunctionOnNextCall(p.normalize)');
p.normalize(input);
bench.start();
for (var i = 0; i < n; i++) {
p.normalize(input);
@@ -1,7 +1,6 @@
'use strict';
var common = require('../common.js');
var path = require('path');
var v8 = require('v8');
var bench = common.createBenchmark(main, {
path: [
@@ -21,15 +20,12 @@ function main(conf) {
var p = path.posix;
var input = '' + conf.path;
// Force optimization before starting the benchmark
p.parse(input);
v8.setFlagsFromString('--allow_natives_syntax');
eval('%OptimizeFunctionOnNextCall(p.parse)');
p.parse(input);
bench.start();
for (var i = 0; i < n; i++) {
p.parse(input);
}
bench.start();
for (i = 0; i < n; i++) {
p.parse(input);
}
bench.end(n);
}
@@ -1,7 +1,6 @@
'use strict';
var common = require('../common.js');
var path = require('path');
var v8 = require('v8');
var bench = common.createBenchmark(main, {
path: [
@@ -22,15 +21,12 @@ function main(conf) {
var p = path.win32;
var input = '' + conf.path;
// Force optimization before starting the benchmark
p.parse(input);
v8.setFlagsFromString('--allow_natives_syntax');
eval('%OptimizeFunctionOnNextCall(p.parse)');
p.parse(input);
bench.start();
for (var i = 0; i < n; i++) {
p.parse(input);
}
bench.start();
for (i = 0; i < n; i++) {
p.parse(input);
}
bench.end(n);
}
@@ -1,7 +1,6 @@
'use strict';
var common = require('../common.js');
var path = require('path');
var v8 = require('v8');
var bench = common.createBenchmark(main, {
paths: [
@@ -26,15 +25,12 @@ function main(conf) {
to = from.slice(delimIdx + 1);
from = from.slice(0, delimIdx);
}
// Force optimization before starting the benchmark
p.relative(from, to);
v8.setFlagsFromString('--allow_natives_syntax');
eval('%OptimizeFunctionOnNextCall(p.relative)');
p.relative(from, to);
for (var i = 0; i < n; i++) {
p.relative(from, to);
}
bench.start();
for (var i = 0; i < n; i++) {
for (i = 0; i < n; i++) {
p.relative(from, to);
}
bench.end(n);
Oops, something went wrong.

0 comments on commit eba2c62

Please sign in to comment.