-
-
Notifications
You must be signed in to change notification settings - Fork 527
Expand file tree
/
Copy pathprof.sh
More file actions
32 lines (27 loc) · 630 Bytes
/
prof.sh
File metadata and controls
32 lines (27 loc) · 630 Bytes
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
#!/bin/bash
export CDPATH=
set -e
set -x
. patterns.sh
bash -x make-benchmark-fixture.sh
wd=$PWD
tmp="$wd/bench-working-dir"
cd "$tmp"
export __GLOB_PROFILE__=1
cat > "profscript.mjs" <<MJS
import { glob } from '$wd/dist/mjs/index.js'
const patterns = process.argv.slice(2)
for (const p of patterns) {
glob.sync("./fixture/" + p)
}
await Promise.all(patterns.map(async p => {
await glob("./fixture/" + p)
}))
MJS
node --prof profscript.mjs "${patterns[@]}" &> profile.out
mkdir -p profiles
d=./profiles/$(date +%s)
mv isolate*.log ${d}.log
node --prof-process ${d}.log > ${d}.txt
cp ${d}.txt ../profile.txt
#cat ${d}.txt