mirror of
https://github.com/nodejs/node.git
synced 2026-11-24 21:50:36 -05:00
benchmark: refactor to eliminate redeclared vars
In order to comply with linting rules used in the rest of the code base, eliminate redeclared variables. A conservative approach is used so as to avoid unintentional performance issues (for example, as might be seen in some situations when using `let` instead of `var`). PR-URL: https://github.com/nodejs/node/pull/5773 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Myles Borins <myles.borins@gmail.com>
This commit is contained in:
1 parent
6dc49ae203
commit
4be2065dbc
10 files changed
+59
-42
No files matched your search
@@ -27,8 +27,16 @@ function main(conf) {
|
||||
v8.setFlagsFromString('--allow_natives_syntax');
|
||||
eval('%OptimizeFunctionOnNextCall(querystring.parse)');
|
||||
|
||||
bench.start();
|
||||
for (var i = 0; i < n; i += 1)
|
||||
querystring.parse(input);
|
||||
bench.end(n);
|
||||
var i;
|
||||
if (type !== 'multicharsep') {
|
||||
bench.start();
|
||||
for (i = 0; i < n; i += 1)
|
||||
querystring.parse(input);
|
||||
bench.end(n);
|
||||
} else {
|
||||
bench.start();
|
||||
for (i = 0; i < n; i += 1)
|
||||
querystring.parse(input, '&&&&&&&&&&');
|
||||
bench.end(n);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user