summaryrefslogtreecommitdiff
path: root/benchmark
diff options
context:
space:
mode:
authorBartosz Sosnowski <bartosz@janeasystems.com>2017-03-01 12:36:27 +0100
committerBartosz Sosnowski <bartosz@janeasystems.com>2017-03-06 16:31:59 +0100
commit7587a11adc5013721aae3e0bedb7fbd51e1ced5b (patch)
tree160e6f6bafc0034c6c9531603f691ab95f5059e5 /benchmark
parentef8cc301fed5f0b4b3107fae5d896eb27f9519f8 (diff)
downloadandroid-node-v8-7587a11adc5013721aae3e0bedb7fbd51e1ced5b.tar.gz
android-node-v8-7587a11adc5013721aae3e0bedb7fbd51e1ced5b.tar.bz2
android-node-v8-7587a11adc5013721aae3e0bedb7fbd51e1ced5b.zip
benchmark: remove forced optimization from misc
This removes all instances of %OptimizeFunctionOnNextCall from misc benchmarks PR-URL: https://github.com/nodejs/node/pull/9615 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Diffstat (limited to 'benchmark')
-rw-r--r--benchmark/misc/console.js13
-rw-r--r--benchmark/misc/punycode.js4
-rw-r--r--benchmark/misc/util-extend-vs-object-assign.js8
3 files changed, 2 insertions, 23 deletions
diff --git a/benchmark/misc/console.js b/benchmark/misc/console.js
index 9a08a411c5..9c5aec0eee 100644
--- a/benchmark/misc/console.js
+++ b/benchmark/misc/console.js
@@ -4,9 +4,6 @@ const common = require('../common.js');
const assert = require('assert');
const Writable = require('stream').Writable;
const util = require('util');
-const v8 = require('v8');
-
-v8.setFlagsFromString('--allow_natives_syntax');
const methods = [
'restAndSpread',
@@ -51,14 +48,7 @@ function usingArgumentsAndApplyC() {
nullStream.write(util.format.apply(null, arguments) + '\n');
}
-function optimize(method, ...args) {
- method(...args);
- eval(`%OptimizeFunctionOnNextCall(${method.name})`);
- method(...args);
-}
-
function runUsingRestAndConcat(n) {
- optimize(usingRestAndConcat, 'a', 1);
var i = 0;
bench.start();
@@ -70,7 +60,6 @@ function runUsingRestAndConcat(n) {
function runUsingRestAndSpread(n, concat) {
const method = concat ? usingRestAndSpreadC : usingRestAndSpreadTS;
- optimize(method, 'this is %s of %d', 'a', 1);
var i = 0;
bench.start();
@@ -82,7 +71,6 @@ function runUsingRestAndSpread(n, concat) {
function runUsingRestAndApply(n, concat) {
const method = concat ? usingRestAndApplyC : usingRestAndApplyTS;
- optimize(method, 'this is %s of %d', 'a', 1);
var i = 0;
bench.start();
@@ -94,7 +82,6 @@ function runUsingRestAndApply(n, concat) {
function runUsingArgumentsAndApply(n, concat) {
const method = concat ? usingArgumentsAndApplyC : usingArgumentsAndApplyTS;
- optimize(method, 'this is %s of %d', 'a', 1);
var i = 0;
bench.start();
diff --git a/benchmark/misc/punycode.js b/benchmark/misc/punycode.js
index f4d22557ac..b359fbbff4 100644
--- a/benchmark/misc/punycode.js
+++ b/benchmark/misc/punycode.js
@@ -42,8 +42,9 @@ function usingICU(val) {
}
function runPunycode(n, val) {
- common.v8ForceOptimization(usingPunycode, val);
var i = 0;
+ for (; i < n; i++)
+ usingPunycode(val);
bench.start();
for (; i < n; i++)
usingPunycode(val);
@@ -51,7 +52,6 @@ function runPunycode(n, val) {
}
function runICU(n, val) {
- common.v8ForceOptimization(usingICU, val);
var i = 0;
bench.start();
for (; i < n; i++)
diff --git a/benchmark/misc/util-extend-vs-object-assign.js b/benchmark/misc/util-extend-vs-object-assign.js
index caea42ce91..41c15d7d2c 100644
--- a/benchmark/misc/util-extend-vs-object-assign.js
+++ b/benchmark/misc/util-extend-vs-object-assign.js
@@ -2,7 +2,6 @@
const common = require('../common.js');
const util = require('util');
-const v8 = require('v8');
const bench = common.createBenchmark(main, {
type: ['extend', 'assign'],
@@ -12,15 +11,11 @@ const bench = common.createBenchmark(main, {
function main(conf) {
let fn;
const n = conf.n | 0;
- let v8command;
if (conf.type === 'extend') {
fn = util._extend;
- v8command = '%OptimizeFunctionOnNextCall(util._extend)';
} else if (conf.type === 'assign') {
fn = Object.assign;
- // Object.assign is built-in, cannot be optimized
- v8command = '';
}
// Force-optimize the method to test so that the benchmark doesn't
@@ -28,9 +23,6 @@ function main(conf) {
for (var i = 0; i < conf.type.length * 10; i += 1)
fn({}, process.env);
- v8.setFlagsFromString('--allow_natives_syntax');
- eval(v8command);
-
var obj = new Proxy({}, { set: function(a, b, c) { return true; } });
bench.start();