Use iai-callgrind instead of iai #39
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Benchmark | |
on: | |
pull_request: | |
types: [labeled] | |
env: | |
IAI_CALLGRIND_VERSION: 0.7.3 | |
CARGO_TERM_COLOR: always | |
IAI_CALLGRIND_COLOR: never | |
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse | |
jobs: | |
bench: | |
if: contains(github.event.pull_request.labels.*.name, 'run benchmarks') | |
permissions: | |
pull-requests: write | |
env: | |
WORKSPACE: ${{ github.workspace }} | |
URL: ${{ github.event.pull_request.comments_url }} | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.event.pull_request.base.ref }} | |
- uses: dtolnay/rust-toolchain@stable | |
- uses: taiki-e/install-action@cargo-binstall | |
- name: Install iai-callgrind-runner | |
run: cargo binstall --no-confirm --no-symlinks iai-callgrind-runner --version ${IAI_CALLGRIND_VERSION} | |
- name: Bench base branch | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y valgrind | |
cargo update | |
cargo bench -q --bench bench > "${WORKSPACE}"/____old_results.txt | |
- uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.event.pull_request.head.ref }} | |
clean: false | |
- name: Bench head branch | |
run: | | |
cargo update | |
cargo bench -q --bench bench > "${WORKSPACE}"/____results.txt | |
- uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.event.pull_request.base.ref }} | |
clean: false | |
- name: Bench base branch no finalization | |
run: | | |
cargo clean | |
cargo update | |
cargo bench --no-default-features -F auto-collect -q --bench bench > "${WORKSPACE}"/____old_results_no_finalization.txt | |
- uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.event.pull_request.head.ref }} | |
clean: false | |
- name: Bench head branch no finalization | |
run: | | |
cargo update | |
cargo bench --no-default-features -F auto-collect -q --bench bench > "${WORKSPACE}"/____results_no_finalization.txt | |
- name: Write comment | |
run: | | |
{ | |
echo '<strong>Benchmark results:</strong>' | |
echo '' | |
cat "${WORKSPACE}"/____results.txt | |
echo '' | |
echo '<details><summary><strong>Old results:</strong></summary><p>' | |
echo '' | |
cat "${WORKSPACE}"/____old_results.txt | |
echo '</p></details>' | |
echo '' | |
echo '---' | |
echo '' | |
echo '<details><summary><strong>Results without finalization:</strong></summary><p>' | |
echo '' | |
cat "${WORKSPACE}"/____results_no_finalization.txt | |
echo '' | |
echo '<details><summary><strong>Old results without finalization:</strong></summary><p>' | |
echo '' | |
cat "${WORKSPACE}"/____old_results_no_finalization.txt | |
echo '</p></details></p></details>' | |
} > "${WORKSPACE}"/__result.txt | |
- uses: thollander/[email protected] | |
with: | |
filePath: '__result.txt' | |
mode: recreate | |
- name: Remove label | |
uses: actions-ecosystem/[email protected] | |
with: | |
labels: "run benchmarks" |