Skip to content

Commit

Permalink
Benchmark improvements
Browse files Browse the repository at this point in the history
* CI: Clean offline; display cleaned bytes
* Add missing csv bench to iai benchmarks
* Generate flamegraphs for benchmarks
* Validate benchmark results separately
  • Loading branch information
infogulch committed Nov 21, 2023
1 parent a98724e commit 2748536
Show file tree
Hide file tree
Showing 8 changed files with 312 additions and 67 deletions.
7 changes: 5 additions & 2 deletions .github/actions/setup-rust/cleanup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@ set -e

echo Cleanup workspace build artifacts and extra target output

# clean just the direct members of the current workspace, with cargo metadata should generalize to all rust projects
cargo clean -p `cargo metadata --format-version 1 | jq -r '[.workspace_members[]|split(" ")|.[0]]|join(" ")'`
# clean just the direct members of the current workspace, use cargo metadata to generalize to all rust projects
cargo clean -p `cargo metadata --no-deps --offline --format-version 1 | jq -r '[.workspace_members[]|split(" ")|.[0]]|join(" ")'`

# remove directories in /target/ that are not named `debug` or `release`
before=`du -s target | awk '{print $1}'`
find ./target -maxdepth 1 -type d ! -name debug ! -name release ! -name target -exec rm -r {} \;
after=`du -s target | awk '{print $1}'`
echo Deleted $(($before - $after)) bytes from target directory
8 changes: 5 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -158,21 +158,23 @@ jobs:
fail_on: nothing
comment_mode: off

- run: cargo build --bench run_iai --release
- run: cargo build --all-targets --release
- run: cargo test --bench setup --release
- run: cargo bench --bench run_iai
- run: cargo bench --bench run_criterion
- run: cargo bench --bench run_criterion -- --profile-time 60

- name: Publish criterion benchmark results
uses: actions/upload-artifact@v3
with:
name: bench-criterion-results
path: target/criterion/**/*
path: target/criterion/*

- name: Publish iai benchmark results
uses: actions/upload-artifact@v3
with:
name: bench-iai-results
path: target/iai/scryer-prolog/run_iai/bench_group/*
path: target/iai/*

# Publish binaries when building for a tag
release:
Expand Down
Loading

0 comments on commit 2748536

Please sign in to comment.