Skip to content

Commit fae10f0

Browse files
committed
remove instruction counting in ci since it's unsupported
1 parent fae175b commit fae10f0

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

justfile

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff 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

108112
measure-all:
109113
#!/usr/bin/env bash

0 commit comments

Comments
 (0)