File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -100,10 +100,14 @@ measure what: (_check "bc hyperfine max_rss jq sponge")
100100 max_rss -ro STATS -- $(cat CMD)
101101 jq ' . += {"max_rss": ' $(cat STATS)' }' " $out" | sponge " $out"
102102
103- perf_out=$(perf stat -x, -e cycles,instructions $(cat CMD) 2 >&1 >/ dev/ null)
104- echo " $perf_out" | awk -F, ' $3~/^cycles/{print $1}' > CYCLES
105- echo " $perf_out" | awk -F, ' $3~/^instructions/{print $1}' > INSTRUCTIONS
106- jq ' . += {"cycles": ' $(cat CYCLES)' ,"instructions": ' $(cat INSTRUCTIONS)' }' " $out" | sponge " $out"
103+ if ! $CI; then
104+ perf_out=$(perf stat -x, -e cycles,instructions $(cat CMD) 2 >&1 >/ dev/ null)
105+ echo " $perf_out" | awk -F, ' $3~/^cycles/{print $1}' > CYCLES
106+ echo " $perf_out" | awk -F, ' $3~/^instructions/{print $1}' > INSTRUCTIONS
107+ jq ' . += {"cycles": ' $(cat CYCLES)' ,"instructions": ' $(cat INSTRUCTIONS)' }' " $out" | sponge " $out"
108+ else
109+ jq ' . += {"cycles": null,"instructions": null}' " $out" | sponge " $out"
110+ fi
107111
108112measure-all :
109113 #!/usr/bin/env bash
You can’t perform that action at this time.
0 commit comments