From 903b9dbc57920e2016cd87c75b1f49bcffe6a15e Mon Sep 17 00:00:00 2001 From: JY Tan Date: Mon, 19 Jan 2026 20:16:30 -0800 Subject: [PATCH 1/2] Commit --- benchmarks/bench/fixed_qps_latency.py | 2 ++ benchmarks/bench/realistic_workload.py | 2 ++ benchmarks/bench/sdk_sampling_rates.py | 2 ++ 3 files changed, 6 insertions(+) diff --git a/benchmarks/bench/fixed_qps_latency.py b/benchmarks/bench/fixed_qps_latency.py index b74a2d5..709f7a2 100644 --- a/benchmarks/bench/fixed_qps_latency.py +++ b/benchmarks/bench/fixed_qps_latency.py @@ -8,6 +8,8 @@ sends requests at a steady rate to measure realistic latency impact. """ +from __future__ import annotations + import json import os import subprocess diff --git a/benchmarks/bench/realistic_workload.py b/benchmarks/bench/realistic_workload.py index 7d7edf8..53daa04 100644 --- a/benchmarks/bench/realistic_workload.py +++ b/benchmarks/bench/realistic_workload.py @@ -9,6 +9,8 @@ These simulate production APIs that do actual work (I/O, validation, processing). """ +from __future__ import annotations + import json import os import subprocess diff --git a/benchmarks/bench/sdk_sampling_rates.py b/benchmarks/bench/sdk_sampling_rates.py index 929362c..9a65d4b 100644 --- a/benchmarks/bench/sdk_sampling_rates.py +++ b/benchmarks/bench/sdk_sampling_rates.py @@ -1,6 +1,8 @@ #!/usr/bin/env python3 """Benchmark: SDK with different sampling rates.""" +from __future__ import annotations + import os import shutil import sys From 1f7700bd9ae2d5509791aec74481dc86e897b255 Mon Sep 17 00:00:00 2001 From: JY Tan Date: Mon, 19 Jan 2026 20:27:00 -0800 Subject: [PATCH 2/2] Fix --- .github/workflows/benchmarks.yml | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/.github/workflows/benchmarks.yml b/.github/workflows/benchmarks.yml index 87af87b..8159620 100644 --- a/.github/workflows/benchmarks.yml +++ b/.github/workflows/benchmarks.yml @@ -51,7 +51,7 @@ jobs: - name: Get system info id: sysinfo run: | - echo "python_version=$(python --version)" >> $GITHUB_OUTPUT + echo "python_version=$(uv run python --version)" >> $GITHUB_OUTPUT echo "os=$(uname -s)" >> $GITHUB_OUTPUT echo "arch=$(uname -m)" >> $GITHUB_OUTPUT echo "cpu_count=$(nproc)" >> $GITHUB_OUTPUT @@ -159,9 +159,10 @@ jobs: jq -r ' "| Endpoint | Baseline | SDK (100%) | Overhead | SDK (10%) | Overhead |", "|----------|----------|------------|----------|-----------|----------|", - (.comparison_100 | to_entries[] | - "| \(.key) | \(.value.baseline_mean_ms | . * 10 | round / 10)ms | \(.value.sdk_mean_ms | . * 10 | round / 10)ms | +\(.value.mean_overhead_ms | . * 10 | round / 10)ms (\(.value.mean_overhead_pct | round)%) | - | - |" - ) + (.comparison_100 | keys[]) as $key | + (.comparison_100[$key]) as $c100 | + (.comparison_10[$key] // null) as $c10 | + "| \($key) | \($c100.baseline_mean_ms * 10 | round / 10)ms | \($c100.sdk_mean_ms * 10 | round / 10)ms | +\($c100.mean_overhead_ms * 10 | round / 10)ms (\($c100.mean_overhead_pct | round)%) | \(if $c10 then "\($c10.sdk_mean_ms * 10 | round / 10)ms" else "-" end) | \(if $c10 then "+\($c10.mean_overhead_ms * 10 | round / 10)ms (\($c10.mean_overhead_pct | round)%)" else "-" end) |" ' benchmarks/results/realistic-workload.json >> "$SUMMARY_FILE" cat >> "$SUMMARY_FILE" << 'EOF' @@ -175,11 +176,15 @@ jobs: jq -r ' "| QPS | Baseline | SDK (100%) | Overhead | SDK (10%) | Overhead |", "|-----|----------|------------|----------|-----------|----------|", - (.baseline | to_entries[] | - . as $b | - ($b.key | tostring) as $qps | - "| \($qps) | \($b.value.mean_ms | . * 10 | round / 10)ms | - | - | - | - |" - ) + (.baseline | keys[] | tonumber) as $qps | + (.baseline["\($qps)"].mean_ms) as $base | + (.sdk_100["\($qps)"].mean_ms // null) as $sdk100 | + (.sdk_10["\($qps)"].mean_ms // null) as $sdk10 | + (if $sdk100 then (($sdk100 - $base) * 10 | round / 10) else null end) as $overhead100 | + (if $sdk10 then (($sdk10 - $base) * 10 | round / 10) else null end) as $overhead10 | + (if $sdk100 then ((($sdk100 - $base) / $base * 100) | round) else null end) as $pct100 | + (if $sdk10 then ((($sdk10 - $base) / $base * 100) | round) else null end) as $pct10 | + "| \($qps) | \($base * 10 | round / 10)ms | \(if $sdk100 then "\($sdk100 * 10 | round / 10)ms" else "-" end) | \(if $overhead100 then "+\($overhead100)ms (\($pct100)%)" else "-" end) | \(if $sdk10 then "\($sdk10 * 10 | round / 10)ms" else "-" end) | \(if $overhead10 then "+\($overhead10)ms (\($pct10)%)" else "-" end) |" ' benchmarks/results/fixed-qps-latency.json >> "$SUMMARY_FILE" cat >> "$SUMMARY_FILE" << 'EOF'