Repository navigation
83 lines (69 loc) · 2.43 KB
/
Copy pathbenchmark.yml
File metadata and controls
83 lines (69 loc) · 2.43 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
72
73
74
75
76
77
78
79
80
81
82
83
name: Performance Benchmarks
permissions:
contents: read
# Run benchmarks on a schedule and manual trigger only
on:
# Run weekly on Sunday at 2 AM UTC
schedule:
- cron: "0 2 * * 0"
# Allow manual triggering for on-demand performance testing
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: full
jobs:
benchmark:
name: Run Performance Benchmarks
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0 # Full history for performance comparison
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y protobuf-compiler
- name: Cache Rust dependencies
uses: Swatinem/rust-cache@v2
with:
# Cache key includes benchmark to avoid interference with test cache
key: benchmark-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }}
- name: Run benchmarks
run: |
echo "========================================="
echo "Running d-engine Performance Benchmarks"
echo "========================================="
echo ""
echo "Performance Targets:"
echo " • Without TTL: < 10ns overhead"
echo " • With TTL passive check: < 50ns overhead"
echo " • Piggyback cleanup: < 1ms"
echo ""
# Run benchmarks and save output
cargo bench --package d-engine-server 2>&1 | tee benchmark_output.txt
echo ""
echo "✅ Benchmarks completed successfully"
- name: Upload detailed results as artifact
uses: actions/upload-artifact@v4
with:
name: benchmark-results
path: |
target/criterion/
benchmark_output.txt
retention-days: 30
- name: Performance summary
run: |
echo "========================================="
echo "Performance Benchmark Summary"
echo "========================================="
echo ""
echo "📊 Benchmark results uploaded as artifacts"
echo ""
echo "To view detailed results:"
echo " 1. Download the artifact"
echo " 2. Open target/criterion/report/index.html in your browser"
echo ""
echo "✅ Performance monitoring complete"