-
-
Notifications
You must be signed in to change notification settings - Fork 0
73 lines (62 loc) · 2.33 KB
/
Copy pathcodeprofiling.yml
File metadata and controls
73 lines (62 loc) · 2.33 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
name: hotpath-profile
on:
pull_request:
permissions:
contents: read
jobs:
profile:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- id: head_timing_metrics
run: |
# Extract timing metrics from head branch
{
echo 'metrics<<EOF'
cargo run --example benchmark --features='hotpath,hotpath-ci' | grep '^{"hotpath_profiling_mode"'
echo 'EOF'
} >> "$GITHUB_OUTPUT"
- id: head_alloc_metrics
run: |
# Extract alloc metrics from head branch
{
echo 'metrics<<EOF'
cargo run --example benchmark --features='hotpath,hotpath-ci,hotpath-alloc-count-total' | grep '^{"hotpath_profiling_mode"'
echo 'EOF'
} >> "$GITHUB_OUTPUT"
- name: Checkout base
run: |
git checkout ${{ github.event.pull_request.base.sha }}
- id: base_timing_metrics
run: |
# Extract timing metrics from base branch
{
echo 'metrics<<EOF'
cargo run --example benchmark --features='hotpath,hotpath-ci' | grep '^{"hotpath_profiling_mode"'
echo 'EOF'
} >> "$GITHUB_OUTPUT"
- id: base_alloc_metrics
run: |
# Extract alloc metrics from base branch
{
echo 'metrics<<EOF'
cargo run --example benchmark --features='hotpath,hotpath-ci,hotpath-alloc-count-total' | grep '^{"hotpath_profiling_mode"'
echo 'EOF'
} >> "$GITHUB_OUTPUT"
- name: Save metrics to artifact
run: |
mkdir -p /tmp/metrics
echo '${{ steps.head_timing_metrics.outputs.metrics }}' > /tmp/metrics/head_timing.json
echo '${{ steps.base_timing_metrics.outputs.metrics }}' > /tmp/metrics/base_timing.json
echo '${{ steps.head_alloc_metrics.outputs.metrics }}' > /tmp/metrics/head_alloc.json
echo '${{ steps.base_alloc_metrics.outputs.metrics }}' > /tmp/metrics/base_alloc.json
echo '${{ github.event.pull_request.number }}' > /tmp/metrics/pr_number.txt
- uses: actions/upload-artifact@v4
with:
name: profile-metrics
path: /tmp/metrics/
retention-days: 1