Skip to content

Commit cfa9e43

Browse files
authored
Add GitHub Actions workflow for benchmarks
1 parent 3be947b commit cfa9e43

1 file changed

Lines changed: 71 additions & 0 deletions

File tree

.github/workflows/benchmarks.yml

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: ProXPL Real Benchmarks
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches: [ main ]
7+
8+
jobs:
9+
benchmark:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout repo
14+
uses: actions/checkout@v4
15+
16+
- name: Install dependencies
17+
run: |
18+
sudo apt update
19+
sudo apt install -y build-essential time openjdk-17-jdk
20+
21+
- name: Setup Rust
22+
uses: actions/setup-rust@v1
23+
24+
- name: Setup Go
25+
uses: actions/setup-go@v5
26+
with:
27+
go-version: '1.22'
28+
29+
- name: Build ProXPL
30+
run: |
31+
make || true
32+
33+
- name: Build C
34+
run: |
35+
gcc benchmarks/fib/fib.c -O3 -o fib_c
36+
37+
- name: Build C++
38+
run: |
39+
g++ benchmarks/fib/fib.cpp -O3 -o fib_cpp
40+
41+
- name: Build Rust
42+
run: |
43+
rustc benchmarks/fib/fib.rs -O -o fib_rs
44+
45+
- name: Build Go
46+
run: |
47+
go build -o fib_go benchmarks/fib/fib.go
48+
49+
- name: Build Java
50+
run: |
51+
javac benchmarks/fib/fib.java
52+
53+
- name: Run benchmarks
54+
run: |
55+
echo "LANGUAGE,REAL_TIME_SEC" > results.csv
56+
57+
/usr/bin/time -f "C,%e" ./fib_c 2>> results.csv
58+
/usr/bin/time -f "C++,%e" ./fib_cpp 2>> results.csv
59+
/usr/bin/time -f "Rust,%e" ./fib_rs 2>> results.csv
60+
/usr/bin/time -f "Go,%e" ./fib_go 2>> results.csv
61+
/usr/bin/time -f "Java,%e" java Fib 2>> results.csv
62+
63+
/usr/bin/time -f "ProXPL,%e" ./prox benchmarks/fib/fib.prox 2>> results.csv || true
64+
65+
cat results.csv
66+
67+
- name: Upload benchmark results
68+
uses: actions/upload-artifact@v4
69+
with:
70+
name: proxpl-benchmark-results
71+
path: results.csv

0 commit comments

Comments
 (0)