Skip to content

Commit 75cdc89

Browse files
committed
benchmark: cleanup after forced optimization drop
This removes all instances of %OptimizeFunctionOnNextCall from common.js and README.md PR-URL: #9615 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
1 parent ca86aa5 commit 75cdc89

File tree

2 files changed

+0
-23
lines changed

2 files changed

+0
-23
lines changed

benchmark/README.md

-9
Original file line numberDiff line numberDiff line change
@@ -235,12 +235,3 @@ it returns to accomplish what they need. This function reports timing
235235
data to the parent process (usually created by running `compare.js`, `run.js` or
236236
`scatter.js`).
237237

238-
### v8ForceOptimization(method[, ...args])
239-
240-
Force V8 to mark the `method` for optimization with the native function
241-
`%OptimizeFunctionOnNextCall()` and return the optimization status
242-
after that.
243-
244-
It can be used to prevent the benchmark from getting disrupted by the optimizer
245-
kicking in halfway through. However, this could result in a less effective
246-
optimization. In general, only use it if you know what it actually does.

benchmark/common.js

-14
Original file line numberDiff line numberDiff line change
@@ -229,17 +229,3 @@ Benchmark.prototype.report = function(rate, elapsed) {
229229
type: 'report'
230230
});
231231
};
232-
233-
exports.v8ForceOptimization = function(method) {
234-
if (typeof method !== 'function')
235-
return;
236-
237-
const v8 = require('v8');
238-
v8.setFlagsFromString('--allow_natives_syntax');
239-
240-
const args = Array.prototype.slice.call(arguments, 1);
241-
method.apply(null, args);
242-
eval('%OptimizeFunctionOnNextCall(method)');
243-
method.apply(null, args);
244-
return eval('%GetOptimizationStatus(method)');
245-
};

0 commit comments

Comments
 (0)