Skip to content

Commit

Permalink
Use sed to process bench output
Browse files Browse the repository at this point in the history
  • Loading branch information
slowli committed Oct 28, 2024
1 parent 93536a7 commit 66df17c
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions .github/workflows/vm-perf-comparison.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ jobs:
echo "SCCACHE_GCS_SERVICE_ACCOUNT=gha-ci-runners@matterlabs-infra.iam.gserviceaccount.com" >> .env
echo "SCCACHE_GCS_RW_MODE=READ_WRITE" >> .env
echo "RUSTC_WRAPPER=sccache" >> .env
# Set the minimum reported instruction count difference to reduce noise
echo "BENCHMARK_DIFF_THRESHOLD_PERCENT=2" >> .env
# Set the minimum reported instruction count difference to reduce noise. FIXME
echo "BENCHMARK_DIFF_THRESHOLD_PERCENT=-1" >> .env
- name: init
run: |
Expand All @@ -68,14 +68,17 @@ jobs:
ci_run zkstack dev contracts --system-contracts
ci_run cargo bench --package vm-benchmark --bench instructions -- --verbose
ci_run cargo bench --package vm-benchmark --bench instructions -- --print > instructions.log 2>/dev/null
# Output all lines from the benchmark result starting from the "## ..." comparison header.
# Since the output spans multiple lines, we use a heredoc declaration.
EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64)
echo "speedup<<$EOF" >> $GITHUB_OUTPUT
# Output all lines starting from the "## ..." comparison header. Ignore the `grep` error if no lines were matched
ci_run cargo bench --package vm-benchmark --bench instructions -- --print | grep -A 1000 --color=never -e '^## ' >> $GITHUB_OUTPUT || [ "$?" = 1 ]
sed -n '/^## /,$p' instructions.log >> $GITHUB_OUTPUT
echo "$EOF" >> $GITHUB_OUTPUT
ci_run cargo run --package vm-benchmark --release --bin instruction_counts -- --diff base-opcodes > opcodes.log
echo "opcodes<<$EOF" >> $GITHUB_OUTPUT
ci_run cargo run --package vm-benchmark --release --bin instruction_counts -- --diff base-opcodes | grep -A 1000 --color=never -e '^## ' >> $GITHUB_OUTPUT || [ "$?" = 1 ]
sed -n '/^## /,$p' opcodes.log >> $GITHUB_OUTPUT
echo "$EOF" >> $GITHUB_OUTPUT
- name: Comment on PR
Expand Down

0 comments on commit 66df17c

Please sign in to comment.