Skip to content

Commit

Permalink
fix: update times
Browse files Browse the repository at this point in the history
  • Loading branch information
atanmarko committed Oct 7, 2024
1 parent 33ba6b5 commit 380e311
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
13 changes: 10 additions & 3 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ on:
workflow_dispatch:
branches:
- "**"

pull_request:
branches:
- "**"

env:
BENCHMARK_WITNESS: artifacts/witness_b19807080.json
Expand All @@ -25,6 +27,7 @@ jobs:
- name: Build the project
run: |
RUSTFLAGS='-C target-cpu=native -Zlinker-features=-lld -Copt-level=3' cargo build --release
sudo echo 0 > /proc/sys/kernel/perf_event_paranoid
- name: Download previous results
uses: dawidd6/action-download-artifact@v6
Expand All @@ -40,8 +43,12 @@ jobs:
run: |
echo "Benchmarking proving with $BENCHMARK_WITNESS"
./scripts/benchmark_input.sh $BENCHMARK_WITNESS | tee benchmark_output.log
MEASURED_PROVING_TIME_SEC=`cat benchmark_output.log | grep 'Proving duration:' | tail -1 | awk '{ print int($3)}'`
printf '%s sec: %10s %s\n' `date --utc +%y-%m-%d-%H:%M:%S` $MEASURED_PROVING_TIME_SEC $BENCHMARK_WITNESS >> proving_benchmark_results.txt
MEASURED_PROVING_TIME_SEC=`cat benchmark_output.log | grep 'Proving duration:' | tail -1 | awk '{ print $3}'`
PERF_TIME=`cat output.log | grep "seconds time elapsed" | tail -1 | awk '{ print ($1)}'`
PERF_USER_TIME=`cat output.log | grep "seconds user" | tail -1 | awk '{ print ($1)}'`
PERF_SYS_TIME=`cat output.log | grep "seconds sys" | tail -1 | awk '{ print ($1)}'`
printf 'TIME OF TEST RUN ID WALL CLOCK TIME(s) PERF TIME(s) PERF USER TIME(s) PERF SYS TIME(s) WITNESS FILE\n' > proving_benchmark_results.txt
printf '%12s %-12s %-12s %-12s %-12s %-12s %-s\n' `date --utc +%y-%m-%d-%H:%M:%S` ${{ github.run_id }} $MEASURED_PROVING_TIME_SEC $PERF_TIME $PERF_USER_TIME $PERF_SYS_TIME $BENCHMARK_WITNESS >> proving_benchmark_results.txt
- name: Upload new results
uses: actions/upload-artifact@v4
Expand Down
2 changes: 1 addition & 1 deletion scripts/benchmark_input.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ if [[ $INPUT_FILE == "" ]]; then
fi

start_time=$(date +%s%N)
"${REPO_ROOT}/target/release/leader" --runtime in-memory --load-strategy monolithic --block-batch-size $BLOCK_BATCH_SIZE \
perf stat -e cycles "${REPO_ROOT}/target/release/leader" --runtime in-memory --load-strategy monolithic --block-batch-size $BLOCK_BATCH_SIZE \
--proof-output-dir $PROOF_OUTPUT_DIR stdio < $INPUT_FILE &> $OUTPUT_LOG
end_time=$(date +%s%N)

Expand Down

0 comments on commit 380e311

Please sign in to comment.