Skip to content

Pin dependencies

Pin dependencies #51

Workflow file for this run

# CI for performance benchmarking
# Domains of interest:
# * startup speed (== to parse and load all rules)
# * network filter matching (== the avg time to check a request)
# * first request matching delay (== time to check the first request)
# * memory usage after loading rules and after a few requests
name: Performance CI
on:
push:
branches: [ master ]
pull_request:
permissions:
contents: write
pages: write
pull-requests: write
jobs:
benchmark:
name: Performance benchmarking
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- name: Bench network filter matching
run: cargo bench --bench bench_matching rule-match-browserlike/brave-list -- --output-format bencher | tee -a output.txt
- name: Bench first request matching delay
run: cargo bench --bench bench_matching rule-match-first-request -- --output-format bencher | tee -a output.txt
- name: Bench startup speed
run: cargo bench --bench bench_rules blocker_new/brave-list -- --output-format bencher | tee -a output.txt
- name: Bench memory usage
run: cargo bench --bench bench_memory -- --output-format bencher | tee -a output.txt
- name: Store benchmark result
uses: benchmark-action/github-action-benchmark@d48d326b4ca9ba73ca0cd0d59f108f9e02a381c7 # v1.20.4
with:
name: Rust Benchmark
tool: 'cargo'
output-file-path: output.txt
github-token: ${{ secrets.GITHUB_TOKEN }}
alert-threshold: '130%' # fails on +30% regression
comment-on-alert: true
fail-on-alert: true
comment-always: true
# Upload results only for master
auto-push: ${{ github.ref == 'refs/heads/master' }}