Repository navigation
103 lines (100 loc) · 3.9 KB
/
Copy pathhotpath-benchmark.yml
File metadata and controls
103 lines (100 loc) · 3.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
name: Benchmark
on:
push:
branches: [main]
pull_request:
jobs:
upload:
name: benchmark (push)
if: github.event_name == 'push'
runs-on: ubuntu-26.04
timeout-minutes: 45
permissions:
contents: read
id-token: write
env:
HOTPATH_BENCHMARK: performance
HOTPATH_USER_METADATA: runner=Linux-X64,toolchain=nightly-2026-10-15,profile=hotpath,valgrind=3.26.0
HOTPATH_OUTPUT_FORMAT: json
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: "nightly-2026-10-15"
- uses: Swatinem/rust-cache@v2
- name: Install valgrind
run: |
sudo apt-get update
sudo apt-get install -y valgrind=1:3.26.0-0ubuntu1
- name: Build benchmark
run: |
cargo build -q --profile hotpath -p andromeda --bin andromeda \
--features hotpath-alloc,hotpath-cloud,hotpath-callgrind
- name: Run benchmark natively
env:
HOTPATH_OUTPUT_PATH: ${{ runner.temp }}/native.json
run: target/hotpath/andromeda run examples/performance.ts
- name: Run benchmark under Callgrind and upload the merged report
env:
HOTPATH_UPLOAD: fail-on-error
HOTPATH_UPLOAD_RESPONSE_PATH: ${{ github.workspace }}/upload.json
HOTPATH_OUTPUT_PATH: ${{ runner.temp }}/merged.json
HOTPATH_MERGE_REPORT: ${{ runner.temp }}/native.json
HOTPATH_CALLGRIND_OUT_FILE: ${{ runner.temp }}/callgrind.out.%p
run: |
valgrind -q --tool=callgrind --instr-atstart=no \
--callgrind-out-file="$HOTPATH_CALLGRIND_OUT_FILE" \
target/hotpath/andromeda run examples/performance.ts
test -s "$HOTPATH_UPLOAD_RESPONSE_PATH"
jq -e '.meta.run == "merged" and (.functions_icount.data | length > 0) and (.functions_timing.data | length > 0)' \
"$HOTPATH_OUTPUT_PATH" > /dev/null
report:
name: benchmark (pull request)
if: github.event_name == 'pull_request'
runs-on: ubuntu-26.04
timeout-minutes: 45
permissions:
contents: read
env:
HOTPATH_BENCHMARK: performance
HOTPATH_USER_METADATA: runner=Linux-X64,toolchain=nightly-2026-10-15,profile=hotpath,valgrind=3.26.0
HOTPATH_OUTPUT_FORMAT: json
steps:
- uses: actions/checkout@v4
with:
# The pull request's head commit, not the default merge commit.
ref: ${{ github.event.pull_request.head.sha }}
- uses: dtolnay/rust-toolchain@master
with:
toolchain: "nightly-2026-10-15"
- uses: Swatinem/rust-cache@v2
- name: Install valgrind
run: |
sudo apt-get update
sudo apt-get install -y valgrind=1:3.26.0-0ubuntu1
- name: Build benchmark
run: |
cargo build -q --profile hotpath -p andromeda --bin andromeda \
--features hotpath-alloc,hotpath-cloud,hotpath-callgrind
- name: Run benchmark natively
env:
HOTPATH_OUTPUT_PATH: ${{ runner.temp }}/native.json
run: target/hotpath/andromeda run examples/performance.ts
- name: Run benchmark under Callgrind and write the merged report
env:
HOTPATH_OUTPUT_PATH: report.json
HOTPATH_MERGE_REPORT: ${{ runner.temp }}/native.json
HOTPATH_CALLGRIND_OUT_FILE: ${{ runner.temp }}/callgrind.out.%p
run: |
valgrind -q --tool=callgrind --instr-atstart=no \
--callgrind-out-file="$HOTPATH_CALLGRIND_OUT_FILE" \
target/hotpath/andromeda run examples/performance.ts
test -s report.json
jq -e '.meta.run == "merged" and (.functions_icount.data | length > 0) and (.functions_timing.data | length > 0)' \
report.json > /dev/null
- uses: actions/upload-artifact@v4
with:
name: hotpath-report
path: report.json
retention-days: 1
if-no-files-found: error