Skip to content

Commit 7d9d52f

Browse files
committed
benchmark-lsp: make testing more consistent/fair
Some linters, such as ESLint, run in two phases: parse, then lint. 'let x, x;' causes some linters to fail during the first phase, meaning the second phase doesn't run. This makes those linters look faster than they actually are. Fix the error-producing pattern used in our benchmarks to activate only during the last phase of multi-phase linters. On my fast Linux machine, this changes eslint-server/open-wait-close/edex-ui-filesystem.class.js from 44.3~50.8 ms to 69.9~83.4 ms.
1 parent ab2380e commit 7d9d52f

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

benchmark/benchmark-lsp/corpus/edex-ui-filesystem.class.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -740,4 +740,4 @@ class FilesystemDisplay {
740740
module.exports = {
741741
FilesystemDisplay
742742
};
743-
let errorPlease, errorPlease; // Intentional error to force diagnostics.
743+
if (false) undeclaredVariable.hasOwnProperty(); // Intentional error to force diagnostics.

benchmark/benchmark-lsp/corpus/express-router.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -660,4 +660,4 @@ function wrap(old, fn) {
660660
fn.apply(this, args);
661661
};
662662
}
663-
let errorPlease, errorPlease; // Intentional error to force diagnostics.
663+
if (false) undeclaredVariable.hasOwnProperty(); // Intentional error to force diagnostics.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
let x, x;
1+
if (false) undeclaredVariable.hasOwnProperty();

0 commit comments

Comments
 (0)