-
Notifications
You must be signed in to change notification settings - Fork 0
/
bench.mjs
36 lines (31 loc) · 715 Bytes
/
bench.mjs
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
32
33
34
35
36
import { globby } from 'globby'
import { globbyBin } from './npm/index.mjs'
const binStartTime = Date.now()
const binResult = await globbyBin([
'**/*.json',
'!package.json',
'!node_modules/**/*'
])
const binDuration = Date.now() - binStartTime
const nodeStartTime = Date.now()
const nodeResult = await globby([
'**/*.json',
'!package.json',
'!node_modules/**/*'
])
const nodeDuration = Date.now() - nodeStartTime
console.log(
`globby - duration: ${
nodeDuration / 1000
}s; result: ${nodeResult}`
)
console.log(
`go-globby - duration: ${
binDuration / 1000
}s; result: ${binResult}`
)
console.log('\n')
console.log(
'go-globby vs globby -',
(nodeDuration / binDuration).toFixed(2) + ' ↑'
)