-
Notifications
You must be signed in to change notification settings - Fork 157
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
Pedro Fontana
authored and
Pedro Fontana
committed
Mar 19, 2024
1 parent
e1a8b2b
commit 9e51cfa
Showing
2 changed files
with
57 additions
and
2 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,55 @@ | ||
name: Benchmark PR | ||
|
||
on: [pull_request] | ||
|
||
jobs: | ||
benchmark: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout PR | ||
uses: actions/checkout@v2 | ||
with: | ||
ref: ${{ github.head_ref }} | ||
|
||
- name: Install Rust | ||
uses: dtolnay/[email protected] | ||
with: | ||
components: rustfmt, clippy | ||
|
||
- name: Build PR Binary | ||
run: | | ||
cargo build -p hyper_threading --release | ||
mv target/release/hyper_threading target/release/hyper_threading_pr | ||
- name: Checkout main Branch | ||
uses: actions/checkout@v2 | ||
with: | ||
ref: 'main' | ||
|
||
- name: Build main Binary | ||
run: | | ||
cargo build -p hyper_threading --release | ||
mv target/release/hyper_threading target/release/hyper_threading_main | ||
- name: Run Benchmarks | ||
run: | | ||
chmod +x hyper-threading.sh | ||
echo "Benchmarking PR..." | ||
./hyper-threading.sh target/release/hyper_threading_pr > results_pr.txt | ||
echo "Benchmarking main..." | ||
./hyper-threading.sh target/release/hyper_threading_main > results_main.txt | ||
- name: Compare Results | ||
run: | | ||
echo "PR Results:" | ||
cat results_pr.txt | ||
echo "Main Results:" | ||
cat results_main.txt | ||
- name: Upload Results | ||
uses: actions/upload-artifact@master | ||
with: | ||
name: benchmark-results | ||
path: | | ||
results_pr.txt | ||
results_main.txt |
4 changes: 2 additions & 2 deletions
4
hyper-threading.sh → examples/hyper_threading/hyper-threading.sh
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