1
-
1
+ #! /bin/bash
2
2
set +e
3
-
3
+ export OUTPUT_DIR=" /tmp/perf"
4
+ export NODE_OUTPUT_DIR=" ${OUTPUT_DIR} /node"
5
+ export CLINIC_OUTPUT_DIR=" ${OUTPUT_DIR} /clinic"
6
+ mkdir " ${OUTPUT_DIR} "
7
+ mkdir " ${NODE_OUTPUT_DIR} "
8
+ mkdir " ${CLINIC_OUTPUT_DIR} "
9
+ export NODE_OPTIONS=" --experimental-vm-modules --perf-basic-prof --enable-source-maps --stack-trace-limit=1000 --report-dir $NODE_OUTPUT_DIR --perf-prof-unwinding-info --perf-prof"
10
+ # --trace-events-enabled
4
11
# NO_INSIGHT=true clinic doctor -- node --perf-basic-prof --enable-source-maps --stack-trace-limit=1000 ./node_modules/jest-cli/bin/jest.js
5
12
# NO_INSIGHT=true clinic flame -- node --perf-basic-prof --enable-source-maps --stack-trace-limit=1000 ./node_modules/jest-cli/bin/jest.js
6
13
# May Clinic.js report anonymous usage statistics to improve the tool over time?
@@ -10,14 +17,13 @@ set +e
10
17
# NO_INSIGHT=true clinic doctor --collect-only --
11
18
# node /usr/local/bin/pnpm run test
12
19
# ./run-jest-tests.sh
13
- export NODE_OPTIONS=--experimental-vm-modules
20
+
14
21
# export NO_INSIGHT=true
15
22
# npx jest
16
23
# clinic doctor -- node ./node_modules/.bin/../jest/bin/jest.js src/lib/provable/test/int.test.ts
17
24
echo 2 > /proc/sys/kernel/perf_event_paranoid
18
25
19
26
20
-
21
27
# mdupont@mdupont-G470:~/2024/09/20/o1js$ grep PASS report1.txt
22
28
# PASS src/lib/provable/test/merkle-list.test.ts (7.118 s)
23
29
# PASS src/lib/provable/test/merkle-tree.test.ts (7.297 s)
@@ -30,54 +36,47 @@ echo 2 > /proc/sys/kernel/perf_event_paranoid
30
36
# PASS src/lib/mina/precondition.test.ts (12.688 s)
31
37
# PASS src/lib/mina/token.test.ts (46.593 s)
32
38
33
- mkdir /tmp/perf/
34
- TESTS= " src/lib/provable/test/merkle-list. test.ts src/lib/provable/test/merkle-tree.test.ts src/lib/provable/test/scalar.test.ts src/lib/provable/test/merkle-map.test.ts src/lib/provable/test/provable.test.ts src/lib/provable/test/primitives.test.ts src/lib/provable/test/group.test.ts src/lib/provable/test/int.test.ts src/lib/mina/precondition.test.ts src/lib/mina/token.test.ts "
35
- export NO_INSIGHT=true
39
+ TESTS= ` ls -b src/lib/provable/test/ * .test.ts src/lib/mina/ * .test.ts `
40
+ # src/lib/provable/test/*unit- test.ts
41
+ # src/lib/mina/*.unit-test.ts
36
42
43
+ # TESTS="src/lib/provable/test/merkle-list-perf.test.ts"
44
+
45
+ export NO_INSIGHT=true
46
+ export JESTOPTS=--collectCoverage
47
+ export NODEOPT1=" --prof --expose-gc"
37
48
for testname in $TESTS ;
38
49
do
39
- perfdata=${testname} .perf.data
40
- clinic flame -- node --perf-basic-prof ./node_modules/.bin/../jest/bin/jest.js ${testname}
41
- clinic doctor -- node --perf-basic-prof ./node_modules/.bin/../jest/bin/jest.js ${testname}
42
- clinic bubbleprof -- node --perf-basic-prof ./node_modules/.bin/../jest/bin/jest.js ${testname}
43
- clinic heapprofiler -- node --perf-basic-prof ./node_modules/.bin/../jest/bin/jest.js ${testname}
50
+ export MULTIPLE=" ${testname} "
51
+ export perfdata=" ${testname} .perf.data"
52
+ clinic flame -- node $NODEOPT1 ./node_modules/.bin/../jest/bin/jest.js " ${JESTOPTS} " " ${MULTIPLE} "
53
+ clinic doctor -- node $NODEOPT1 ./node_modules/.bin/../jest/bin/jest.js " ${JESTOPTS} " " ${MULTIPLE} "
54
+ clinic bubbleprof -- node $NODEOPT1 ./node_modules/.bin/../jest/bin/jest.js " ${JESTOPTS} " " ${MULTIPLE} "
55
+ clinic heapprofiler -- node $NODEOPT1 ./node_modules/.bin/../jest/bin/jest.js " ${JESTOPTS} " " ${MULTIPLE} "
44
56
45
- perf record -g -o ${testname} .perf.data -F 999 --call-graph dwarf node --perf-basic-prof ./node_modules/.bin/../jest/bin/jest.js ${testname} > ${testname} .reportout.txt 2>&1
57
+ perf record -g -o " ${testname} .perf.data" -F 999 --call-graph dwarf node $NODEOPT1 ./node_modules/.bin/../jest/bin/jest.js " ${JESTOPTS} " " ${MULTIPLE} " > " ${testname} .reportout.txt" 2>&1
46
58
perf archive ${testname} .perf.data
47
59
perf report -i " ${perfdata} " --verbose --stdio --header > " ${perfdata} .header.txt" 2>&1
48
60
perf report -i " ${perfdata} " --verbose --stdio --stats > " ${perfdata} .stats.txt" 2>&1
49
61
perf script -F +pid -i " ${perfdata} " > " ${perfdata} .script.txt" 2>&1
50
62
perf report --stdio -i " ${perfdata} " > " ${perfdata} .report.txt" 2>&1
51
-
52
- cp ${testname} .* /tmp/perf/
53
- mkdir /tmp/perf/clinic
54
- cp -r .clinic/* /tmp/perf/clinic
63
+ cp ${testname} .* " ${OUTPUT_DIR} "
64
+ cp -r .clinic/* " ${CLINIC_OUTPUT_DIR} "
65
+ cp -r coverage/* " ${OUTPUT_DIR} /"
66
+ cp -r jit* .dump " ${OUTPUT_DIR} /"
67
+ cp -r * .log " ${OUTPUT_DIR} /"
55
68
done
56
69
57
70
tar -czf /tmp/perf.data.tar.gz /tmp/perf/*
58
- # perf script > perf_script.txt
59
- # perf report > perf_report.txt
60
- # clinic doctor --collect-only -- node ./node_modules/jest-cli/bin/jest.js ./src/mina-signer/tests/rosetta.test.ts
61
- # clinic doctor --collect-only -- node ./node_modules/.pnpm/@jest+monorepo@https+++codeload.github.com+meta-introspector+jest+tar.gz+4a58402556ecd05ca9cc01873db6fbc5596ccc67/node_modules/@jest/monorepo/packages/jest-cli/bin/jest.js ./src/mina-signer/tests/rosetta.test.ts
62
71
63
72
# + for f in ./src/**/*.test.ts
64
73
# ./src/lib/mina/precondition.test.ts
65
74
# ./src/lib/mina/token.test.ts
66
75
# ./src/lib/provable/test/primitives.test.ts
67
76
68
- # NO_INSIGHT=true clinic doctor --collect-only -- node /usr/local/bin/pnpm run test:integration
69
- # NO_INSIGHT=true clinic doctor --collect-only -- node /usr/local/bin/pnpm run test:unit
70
- # NO_INSIGHT=true clinic doctor --collect-only -- node /usr/local/bin/pnpm run test:e2e
71
-
72
77
# #######
73
78
# NO_INSIGHT=true clinic flame -- node /usr/local/bin/pnpm run test
74
79
# NO_INSIGHT=true clinic flame -- node /usr/local/bin/pnpm run test:integration
75
80
# NO_INSIGHT=true clinic flame -- node /usr/local/bin/pnpm run test:unit
76
81
# NO_INSIGHT=true clinic flame -- node /usr/local/bin/pnpm run test:e2e
77
82
78
- # #clinic flame -- node index.js
79
-
80
- # # pnpm run test
81
- # # pnpm run test:integration
82
- # # pnpm run test:unit
83
- # # pnpm run test:e2e
0 commit comments