diff --git a/.github/workflows/hyper_threading_benchmarks.yml b/.github/workflows/hyper_threading_benchmarks.yml new file mode 100644 index 0000000000..7192d8be78 --- /dev/null +++ b/.github/workflows/hyper_threading_benchmarks.yml @@ -0,0 +1,70 @@ +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: Python3 Build + uses: actions/setup-python@v4 + with: + python-version: '3.9' + - name: Install test dependencies + run: | + pip install -r requirements.txt + sudo apt update + + - name: Compile benchmarks progrmas + run: make cairo_bench_programs + + + - name: Install Rust + uses: dtolnay/rust-toolchain@1.74.1 + 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 \ No newline at end of file