-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathbenchmark-small.js
31 lines (27 loc) · 989 Bytes
/
benchmark-small.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
require("coffeescript/register")
const fs = require("fs")
const path = require("path")
const testutils = require("./testutils")
const Zadeh = require("../index")
const legacy = require("fuzzaldrin-plus")
const lines = fs.readFileSync(path.join(__dirname, "data-small.txt"), "utf8").trim().split("\n")
const forceAllMatch = {
maxInners: -1,
}
const mitigation = {
maxInners: Math.floor(0.2 * lines.length),
}
// warmup + compile
Zadeh.filter(lines, "index", forceAllMatch)
legacy.filter(lines, "index")
testutils.doFilterTest(null, lines, "nm")
testutils.doFilterTest(null, lines, "npm")
testutils.doFilterTest(null, lines, "node")
testutils.doFilterTest(null, lines, "grunt")
testutils.doFilterTest(null, lines, "html")
testutils.doFilterTest(null, lines, "doc")
testutils.doFilterTest(null, lines, "cli")
testutils.doFilterTest(null, lines, "js")
testutils.doFilterTest(null, lines, "jas")
testutils.doFilterTest(null, lines, "mine")
testutils.doFilterTest(null, lines, "stream")