Skip to content

Commit 460aade

Browse files
committed
Add perf-ci.yml
1 parent e8cc677 commit 460aade

File tree

1 file changed

+65
-0
lines changed

1 file changed

+65
-0
lines changed

.github/workflows/perf-ci.yml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# CI for performance benchmarking
2+
# Domains of interest:
3+
# * startup speed (== to parse and load all rules)
4+
# * network filter matching (== the avg time to check a request)
5+
# * first request matching delay (== time to check the first request)
6+
name: CI
7+
8+
on:
9+
push:
10+
branches: [ master ]
11+
pull_request:
12+
13+
permissions:
14+
contents: write
15+
pages: write
16+
pull-requests: write
17+
18+
jobs:
19+
ci:
20+
runs-on: ${{ matrix.os }}
21+
strategy:
22+
fail-fast: false
23+
matrix:
24+
os: [ubuntu-latest]
25+
rust: [stable]
26+
include:
27+
- os: ubuntu-latest
28+
target: Linux
29+
30+
benchmark:
31+
name: Performance benchmarking
32+
runs-on: ubuntu-latest
33+
34+
steps:
35+
- name: Checkout
36+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
37+
38+
- name: setup python
39+
uses: actions/setup-python@v4
40+
41+
- name: Install Rust toolchain
42+
uses: dtolnay/rust-toolchain@master
43+
with:
44+
toolchain: stable
45+
46+
- name: Bench network filter matching
47+
run: cargo bench --bench bench_matching rule-match-browserlike/brave-list -- --output-format bencher | tee -a output.txt
48+
49+
- name: Bench first request matching delay
50+
run: cargo bench --bench bench_matching rule-match-first-request -- --output-format bencher | tee -a output.txt
51+
52+
- name: Bench startup speed
53+
run: cargo bench --bench bench_rules blocker_new/brave-list -- --output-format bencher | tee -a output.txt
54+
55+
- name: Store benchmark result
56+
uses: benchmark-action/github-action-benchmark@v1
57+
with:
58+
name: Rust Benchmark
59+
tool: 'cargo'
60+
output-file-path: output.txt
61+
github-token: ${{ secrets.GITHUB_TOKEN }}
62+
alert-threshold: '130%' # fails on +30% regression
63+
comment-on-alert: true
64+
fail-on-alert: true
65+
comment-always: true

0 commit comments

Comments
 (0)