forked from MCHPR/MCHPRS
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a57884d
commit 353831b
Showing
3 changed files
with
74 additions
and
7 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
name: PGO optimization | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
workflow_dispatch: | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
optimize: | ||
name: Optimize | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout sources | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install Rust toolchain | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
profile: minimal | ||
override: true | ||
components: llvm-tools-preview | ||
|
||
- name: Cache Rust artifacts | ||
uses: Swatinem/rust-cache@v2 | ||
|
||
- name: First Benchmark | ||
run: cargo bench -p mchprs_core --bench chungus_full | ||
|
||
- name: Install cargo-pgo | ||
run: cargo install cargo-pgo | ||
|
||
- name: Build instrumented binary | ||
run: cargo pgo bench -p mchprs_core --bench chungus_full | ||
|
||
- name: Build optimized binary | ||
run: cargo pgo optimize | ||
|
||
- name: Upload release | ||
uses: svenstaro/upload-release-action@v2 | ||
with: | ||
repo_token: ${{ secrets.GITHUB_TOKEN }} | ||
file: ./target/x86_64-unknown-linux-gnu/release/mchprs | ||
asset_name: mchprs_linux_pgo | ||
release_name: MCHPRS | ||
tag: ${{ github.ref }} | ||
overwrite: true | ||
|
||
- name: Upload profiling data | ||
uses: svenstaro/upload-release-action@v2 | ||
with: | ||
repo_token: ${{ secrets.GITHUB_TOKEN }} | ||
file: release.profdata | ||
asset_name: mchprs_linux_pgo_chungus_mandelbrot.profdata | ||
release_name: MCHPRS | ||
tag: ${{ github.ref }} | ||
overwrite: true | ||
|
||
- name: Second Benchmark | ||
run: cargo pgo optimize bench -p mchprs_core --bench chungus_full |
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
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