Skip to content

Commit 78f53e5

Browse files
committed
Add performance baseline workflow and enhance performance test reporting
- Introduced a new GitHub Actions workflow for performance baseline testing. - Updated performance test workflow to compare against baseline metrics. - Integrated tracing for performance profiling in various modules. - Added new dependencies for tracing and enhanced logging capabilities.
1 parent 0972bdd commit 78f53e5

File tree

8 files changed

+597
-76
lines changed

8 files changed

+597
-76
lines changed
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
name: Performance Baseline
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
performance:
13+
name: Performance Baseline
14+
runs-on: ${{ matrix.os }}
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
include:
19+
- os: ubuntu-latest
20+
target: x86_64-unknown-linux-musl
21+
- os: windows-latest
22+
target: x86_64-pc-windows-msvc
23+
- os: macos-latest
24+
target: x86_64-apple-darwin
25+
steps:
26+
- name: Checkout
27+
uses: actions/checkout@v4
28+
29+
- name: Set Python to PATH
30+
uses: actions/setup-python@v5
31+
with:
32+
python-version: "3.12"
33+
34+
- name: Add Conda to PATH (Windows)
35+
if: startsWith(matrix.os, 'windows')
36+
run: |
37+
$path = $env:PATH + ";" + $env:CONDA + "\condabin"
38+
echo "PATH=$path" >> $env:GITHUB_ENV
39+
40+
- name: Add Conda to PATH (Linux)
41+
if: startsWith(matrix.os, 'ubuntu')
42+
run: echo "PATH=$PATH:$CONDA/condabin" >> $GITHUB_ENV
43+
shell: bash
44+
45+
- name: Install Conda + add to PATH (macOS)
46+
if: startsWith(matrix.os, 'macos')
47+
run: |
48+
curl -o ~/miniconda.sh https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-x86_64.sh
49+
bash ~/miniconda.sh -b -p ~/miniconda
50+
echo "PATH=$PATH:$HOME/miniconda/bin" >> $GITHUB_ENV
51+
echo "CONDA=$HOME/miniconda" >> $GITHUB_ENV
52+
shell: bash
53+
54+
- name: Create test Conda environment
55+
run: conda create -n perf-test-env python=3.12 -y
56+
57+
- name: Create test venv
58+
run: python -m venv .venv
59+
shell: bash
60+
61+
- name: Rust Tool Chain setup
62+
uses: dtolnay/rust-toolchain@stable
63+
with:
64+
toolchain: stable
65+
targets: ${{ matrix.target }}
66+
67+
- name: Cargo Fetch
68+
run: cargo fetch
69+
shell: bash
70+
71+
- name: Build Release
72+
run: cargo build --release --target ${{ matrix.target }}
73+
shell: bash
74+
75+
- name: Run Performance Tests
76+
run: cargo test --release --features ci-perf --target ${{ matrix.target }} --test e2e_performance test_performance_summary -- --nocapture 2>&1 | tee perf-output.txt
77+
env:
78+
RUST_BACKTRACE: 1
79+
RUST_LOG: warn
80+
shell: bash
81+
82+
- name: Extract Performance Metrics
83+
id: metrics
84+
run: |
85+
# Extract JSON metrics from test output
86+
if grep -q "JSON metrics:" perf-output.txt; then
87+
# Extract lines after "JSON metrics:" until the closing brace
88+
sed -n '/JSON metrics:/,/^}/p' perf-output.txt | tail -n +2 > metrics.json
89+
echo "Metrics extracted:"
90+
cat metrics.json
91+
else
92+
echo '{"server_startup_ms": 0, "full_refresh_ms": 0, "environments_count": 0}' > metrics.json
93+
echo "No metrics found, created empty metrics"
94+
fi
95+
shell: bash
96+
97+
- name: Upload Performance Baseline Artifact
98+
uses: actions/upload-artifact@v4
99+
with:
100+
name: perf-baseline-${{ matrix.os }}
101+
path: metrics.json
102+
retention-days: 90

0 commit comments

Comments
 (0)