GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — benchmark: remove querystring forced optimization · windwiny/node@57b5ce1

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • benchmark/querystring
    • querystring-parse.js
    • querystring-stringify.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎benchmark/querystring/querystring-parse.js‎

Copy file name to clipboardExpand all lines: benchmark/querystring/querystring-parse.js
+2-13Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,20 @@
11
'use strict';
22
var common = require('../common.js');
33
var querystring = require('querystring');
4-
var v8 = require('v8');
54
var inputs = require('../fixtures/url-inputs.js').searchParams;
65

76
var bench = common.createBenchmark(main, {
87
type: Object.keys(inputs),
98
n: [1e6],
109
});
1110

12-
// A deopt followed by a reopt of main() can happen right when the timed loop
13-
// starts, which seems to have a noticeable effect on the benchmark results.
14-
// So we explicitly disable optimization of main() to avoid this potential
15-
// issue.
16-
v8.setFlagsFromString('--allow_natives_syntax');
17-
eval('%NeverOptimizeFunction(main)');
18-
1911
function main(conf) {
2012
var type = conf.type;
2113
var n = conf.n | 0;
2214
var input = inputs[type];
2315
var i;
24-
25-
// Note: we do *not* use OptimizeFunctionOnNextCall() here because currently
26-
// it causes a deopt followed by a reopt, which could make its way into the
27-
// timed loop. Instead, just execute the function a "sufficient" number of
28-
// times before the timed loop to ensure the function is optimized just once.
16+
// Execute the function a "sufficient" number of times before the timed
17+
// loop to ensure the function is optimized just once.
2918
if (type === 'multicharsep') {
3019
for (i = 0; i < n; i += 1)
3120
querystring.parse(input, '&&&&&&&&&&');
Collapse file

‎benchmark/querystring/querystring-stringify.js‎

Copy file name to clipboardExpand all lines: benchmark/querystring/querystring-stringify.js
-5Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
'use strict';
22
var common = require('../common.js');
33
var querystring = require('querystring');
4-
var v8 = require('v8');
54

65
var bench = common.createBenchmark(main, {
76
type: ['noencode', 'encodemany', 'encodelast'],
@@ -36,10 +35,6 @@ function main(conf) {
3635
for (var name in inputs)
3736
querystring.stringify(inputs[name]);
3837

39-
v8.setFlagsFromString('--allow_natives_syntax');
40-
eval('%OptimizeFunctionOnNextCall(querystring.stringify)');
41-
querystring.stringify(input);
42-
4338
bench.start();
4439
for (var i = 0; i < n; i += 1)
4540
querystring.stringify(input);

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.