diff --git a/benchmark/buffers/buffer-compare-instance-method.js b/benchmark/buffers/buffer-compare-instance-method.js index bb07326f3de218..ff3bc4c1abda98 100644 --- a/benchmark/buffers/buffer-compare-instance-method.js +++ b/benchmark/buffers/buffer-compare-instance-method.js @@ -1,6 +1,5 @@ 'use strict'; const common = require('../common.js'); -const v8 = require('v8'); const bench = common.createBenchmark(main, { size: [16, 512, 1024, 4096, 16386], @@ -20,7 +19,6 @@ function main(conf) { b1[size - 1] = 'b'.charCodeAt(0); - // Force optimization before starting the benchmark switch (args) { case 2: b0.compare(b1, 0); @@ -37,8 +35,6 @@ function main(conf) { default: b0.compare(b1); } - v8.setFlagsFromString('--allow_natives_syntax'); - eval('%OptimizeFunctionOnNextCall(b0.compare)'); switch (args) { case 2: b0.compare(b1, 0); diff --git a/benchmark/buffers/buffer-compare-offset.js b/benchmark/buffers/buffer-compare-offset.js index 17b36f82883426..fd8c96dbce0158 100644 --- a/benchmark/buffers/buffer-compare-offset.js +++ b/benchmark/buffers/buffer-compare-offset.js @@ -1,6 +1,5 @@ 'use strict'; const common = require('../common.js'); -const v8 = require('v8'); const bench = common.createBenchmark(main, { method: ['offset', 'slice'], @@ -9,18 +8,6 @@ const bench = common.createBenchmark(main, { }); function compareUsingSlice(b0, b1, len, iter) { - - // Force optimization before starting the benchmark - Buffer.compare(b0.slice(1, len), b1.slice(1, len)); - v8.setFlagsFromString('--allow_natives_syntax'); - eval('%OptimizeFunctionOnNextCall(Buffer.compare)'); - eval('%OptimizeFunctionOnNextCall(b0.slice)'); - eval('%OptimizeFunctionOnNextCall(b1.slice)'); - Buffer.compare(b0.slice(1, len), b1.slice(1, len)); - doCompareUsingSlice(b0, b1, len, iter); -} - -function doCompareUsingSlice(b0, b1, len, iter) { var i; bench.start(); for (i = 0; i < iter; i++) @@ -29,16 +16,6 @@ function doCompareUsingSlice(b0, b1, len, iter) { } function compareUsingOffset(b0, b1, len, iter) { - len = len + 1; - // Force optimization before starting the benchmark - b0.compare(b1, 1, len, 1, len); - v8.setFlagsFromString('--allow_natives_syntax'); - eval('%OptimizeFunctionOnNextCall(b0.compare)'); - b0.compare(b1, 1, len, 1, len); - doCompareUsingOffset(b0, b1, len, iter); -} - -function doCompareUsingOffset(b0, b1, len, iter) { var i; bench.start(); for (i = 0; i < iter; i++) diff --git a/benchmark/buffers/buffer-swap.js b/benchmark/buffers/buffer-swap.js index c6d7db470bc69a..71e08890910843 100644 --- a/benchmark/buffers/buffer-swap.js +++ b/benchmark/buffers/buffer-swap.js @@ -1,7 +1,6 @@ 'use strict'; const common = require('../common.js'); -const v8 = require('v8'); const bench = common.createBenchmark(main, { aligned: ['true', 'false'], @@ -81,9 +80,7 @@ function main(conf) { const buf = createBuffer(len, aligned === 'true'); const bufferSwap = genMethod(method); - v8.setFlagsFromString('--allow_natives_syntax'); - eval('%OptimizeFunctionOnNextCall(bufferSwap)'); - + bufferSwap(n, buf); bench.start(); bufferSwap(n, buf); bench.end(n);