forked from matter-labs/zksync-era
-
Notifications
You must be signed in to change notification settings - Fork 1
74 lines (61 loc) · 2.29 KB
/
vm-perf-comparison.yml
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
name: Compare VM perfomance to base branch
on:
pull_request:
paths:
- 'core/**'
jobs:
vm-benchmarks:
name: Run VM benchmarks
runs-on: [matterlabs-ci-runner]
steps:
- name: checkout base branch
uses: actions/checkout@v3
with:
submodules: "recursive"
fetch-depth: 0
ref: ${{ github.base_ref }}
- name: fetch PR branch
run: |
git remote add pr_repo ${{ github.event.pull_request.head.repo.clone_url }}
git fetch pr_repo ${{ github.event.pull_request.head.ref }}
- name: fetch merge-base SHA
id: merge_base
run: echo "sha=$(git merge-base HEAD FETCH_HEAD)" >> $GITHUB_OUTPUT
- name: checkout divergence point
run: git checkout ${{ steps.merge_base.outputs.sha }}
- name: setup-env
run: |
touch .env
echo ZKSYNC_HOME=$(pwd) >> $GITHUB_ENV
echo $(pwd)/bin >> $GITHUB_PATH
- name: init
run: |
docker compose up -d zk
- name: run benchmarks on base branch
shell: bash
run: |
ci_run zk
ci_run zk compiler system-contracts
ci_run cargo bench --package vm-benchmark --bench iai | tee base-iai
- name: checkout PR
run: git checkout --force FETCH_HEAD --recurse-submodules
- name: run benchmarks on PR
shell: bash
run: |
ci_run zk
ci_run zk compiler system-contracts
ci_run cargo bench --package vm-benchmark --bench iai | tee pr-iai
EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64)
echo "speedup<<$EOF" >> $GITHUB_OUTPUT
ci_run cargo run --package vm-benchmark --release --bin compare_iai_results base-iai pr-iai >> $GITHUB_OUTPUT
echo "$EOF" >> $GITHUB_OUTPUT
id: comparison
- name: Comment on PR
uses: thollander/actions-comment-pull-request@v2
with:
message: |
${{ steps.comparison.outputs.speedup == '' && '## No performance difference detected (anymore)' || '## Detected VM performance changes' }}
${{ steps.comparison.outputs.speedup }}
comment_tag: vm-performance-changes
mode: recreate
create_if_not_exists: ${{ steps.comparison.outputs.speedup != '' }}