]>
git.proxmox.com Git - pve-eslint.git/blob - eslint/tests/bench/bench.js
1 var Linter
= require("../../lib/linter").Linter
,
4 var config
= require("../../conf/eslint-recommended");
6 var large
= fs
.readFileSync(__dirname
+ "/large.js", "utf8"),
7 medium
= fs
.readFileSync(__dirname
+ "/medium.js", "utf8"),
8 small
= fs
.readFileSync(__dirname
+ "/small.js", "utf8");
15 var linter
= new Linter();
17 benchmark
.runs
= runs
;
18 benchmark(Boolean
, 1);
20 function benchmark(grep
, times
) {
21 console
.profile("all");
22 for(var key
in runs
) {
26 run(runs
[key
], times
);
27 console
.profileEnd(key
);
31 console
.profileEnd("all");
34 function run(content
, times
) {
36 linter
.verify(content
, config
);