Repository navigation
71 lines (60 loc) · 2.16 KB
/
Copy pathbenchmark-gate.yml
File metadata and controls
71 lines (60 loc) · 2.16 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
name: Performance Regression Gate
on:
pull_request:
branches: [main]
paths:
- "src/freshdata/**"
- "benchmarks/**"
- "tests/test_perf_gate.py"
- ".github/workflows/benchmark-gate.yml"
permissions:
contents: read
jobs:
lazy-engine-benchmark:
name: Polars LazyFrame Runtime & Memory Gate
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout PR Head
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
- name: Set up Python 3.12
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
with:
python-version: "3.12"
cache: "pip"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e . polars pandas pyarrow pytest
- name: Run gate & engine unit tests
run: pytest tests/test_polars_engine.py tests/test_benchmark_harness.py tests/test_perf_gate.py -q
- name: Record Candidate (PR Head) Benchmark
run: |
python -m benchmarks.perf_gate record \
--rows 2000000 \
--iterations 3 \
--out /tmp/candidate_metrics.json
cp -r benchmarks /tmp/benchmarks_backup
- name: Checkout Base Branch on Same Runner
run: |
git checkout "${{ github.event.pull_request.base.sha }}"
cp -r /tmp/benchmarks_backup/* benchmarks/
pip install -e . --no-deps
- name: Record Baseline (Base Branch) Benchmark
run: |
python -m benchmarks.perf_gate record \
--rows 2000000 \
--iterations 3 \
--out /tmp/baseline_metrics.json
- name: Evaluate Regression Gate
run: |
git checkout "${{ github.event.pull_request.head.sha }}"
python -m benchmarks.perf_gate compare \
--baseline /tmp/baseline_metrics.json \
--candidate /tmp/candidate_metrics.json \
--max-compile-ms 10.0 \
--max-total-regression-pct 15.0 \
--max-rss-regression-pct 20.0 \
--summary-out "$GITHUB_STEP_SUMMARY"