Add Hyper Threading benchmarks workflow #10
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 Hyper Threading | |
on: | |
pull_request: | |
branches: [ '**' ] | |
jobs: | |
benchmark: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout PR | |
uses: actions/checkout@v2 | |
with: | |
ref: ${{ github.head_ref }} | |
- name: Setup Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.9' | |
- name: Install Dependencies | |
run: | | |
pip install -r requirements.txt | |
sudo apt update | |
sudo apt-get install -y hyperfine | |
- name: Install Rust | |
uses: dtolnay/[email protected] | |
with: | |
components: rustfmt, clippy | |
- name: Compile PR Version | |
run: | | |
make cairo_bench_programs | |
cargo build --release -p hyper_threading | |
cp target/release/hyper_threading ./hyper_threading_pr | |
- name: Checkout Main Branch | |
uses: actions/checkout@v2 | |
with: | |
ref: 'main' | |
- name: Make Script Executable | |
run: chmod +x ./examples/hyper_threading/hyper-threading-workflow.sh | |
- name: Compile Main Version | |
run: | | |
make cairo_bench_programs | |
cargo build --release -p hyper_threading | |
cp target/release/hyper_threading ./hyper_threading_main | |
- name: Run Benchmarks | |
run: ./examples/hyper_threading/hyper-threading-workflow.sh > results_pr.txt | |
- name: Compare Results | |
run: | | |
echo "PR Results:" | |
cat results_pr.txt | |
- name: Upload Results | |
uses: actions/upload-artifact@v2 | |
with: | |
name: benchmark-results | |
path: results_pr.txt |