Skip to content
Open
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
ef87fba
run benchmarks in CI on macOS as well
kukushechkin Nov 10, 2025
bd8637d
custom branch
kukushechkin Nov 11, 2025
9902bde
fixup! custom branch
kukushechkin Nov 11, 2025
595fa37
fixup! custom branch
kukushechkin Nov 11, 2025
23405cb
add command_arguments
kukushechkin Nov 11, 2025
4215137
fixup! add command_arguments
kukushechkin Nov 11, 2025
b3d187e
fixup! add command_arguments
kukushechkin Nov 11, 2025
894bd5e
fixup! add command_arguments
kukushechkin Nov 11, 2025
74758e2
fixup! add command_arguments
kukushechkin Nov 11, 2025
96814a2
fixup! add command_arguments
kukushechkin Nov 11, 2025
c45d188
fixup! add command_arguments
kukushechkin Nov 12, 2025
1fba5f0
fixup! add command_arguments
kukushechkin Nov 12, 2025
2ea75f7
fixup! add command_arguments
kukushechkin Nov 12, 2025
2b3e37c
aaaaaa
kukushechkin Nov 12, 2025
8b18555
fixup! aaaaaa
kukushechkin Nov 12, 2025
af1aaa6
this is horrible
kukushechkin Nov 12, 2025
2ac8a69
run benchmark directly
kukushechkin Nov 12, 2025
3630ed4
BENCHMARK_DISABLE_JEMALLOC=true
kukushechkin Nov 12, 2025
96d685c
Xcode thresholds
kukushechkin Nov 13, 2025
a545e56
use general pool
kukushechkin Nov 13, 2025
d3d3e5c
fixup! use general pool
kukushechkin Nov 13, 2025
94223af
try with jemalloc
kukushechkin Nov 13, 2025
356f95f
break a threshold
kukushechkin Nov 13, 2025
829837a
rename Xcode thresholds folders
kukushechkin Nov 13, 2025
1789f78
unified job name format
kukushechkin Nov 13, 2025
c26818a
TCPEcho is failing
kukushechkin Nov 13, 2025
89b9086
recalculate thresholds on failure
kukushechkin Nov 13, 2025
5b58626
fixup! recalculate thresholds on failure
kukushechkin Nov 13, 2025
127c8f8
fixup! recalculate thresholds on failure
kukushechkin Nov 13, 2025
8b544bd
fixup! TCPEcho is failing
kukushechkin Nov 13, 2025
ebd8fda
updated thresholds
kukushechkin Nov 13, 2025
d6130bd
let’s see if this is reproducible
kukushechkin Nov 13, 2025
1cb7987
remove swift-nio thresholds
kukushechkin Nov 17, 2025
a37d806
do not run benchmarks by default
kukushechkin Nov 17, 2025
d0a6399
check if opt-in works
kukushechkin Nov 17, 2025
5d79b6b
fixup! do not run benchmarks by default
kukushechkin Nov 17, 2025
f5ac867
revert back to the absolute url
kukushechkin Nov 17, 2025
fbbe95c
macos_runner_pool has a default value
kukushechkin Nov 17, 2025
65d4749
remove macos_command_arguments
kukushechkin Nov 17, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
147 changes: 141 additions & 6 deletions .github/workflows/benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,37 @@ on:
description: "Boolean to enable the Windows nightly main Swift version matrix job. Currently has no effect!" # TODO: implement Windows benchmarking
default: false

macos_xcode_16_3_enabled:
type: boolean
description: "Boolean to enable the macOS Xcode 16.3 benchmark job. Defaults to false."
default: false
macos_xcode_16_4_enabled:
type: boolean
description: "Boolean to enable the macOS Xcode 16.4 benchmark job. Defaults to false."
default: false
macos_xcode_26_0_enabled:
type: boolean
description: "Boolean to enable the macOS Xcode 26.0 benchmark job. Defaults to false."
default: false
macos_xcode_26_1_enabled:
type: boolean
description: "Boolean to enable the macOS Xcode 26.1 benchmark job. Defaults to false."
default: false
macos_xcode_latest_beta_enabled:
type: boolean
description: "Boolean to enable the macOS Xcode latest beta benchmark job. Defaults to false."
default: false

macos_runner_pool:
type: string
description: "The runner pool which will be requested for macOS jobs."
default: "nightly"

macos_env_vars:
type: string
description: "Environment variables for macOS jobs as JSON (e.g., '{\"DEBUG\":\"1\",\"LOG_LEVEL\":\"info\"}')."
default: "{}"

linux_env_vars:
type: string
description: "Environment variables for Linux jobs as JSON (e.g., '{\"DEBUG\":\"1\",\"LOG_LEVEL\":\"info\"}')."
Expand All @@ -82,8 +113,8 @@ on:
default: ""

jobs:
construct-matrix:
name: Construct Benchmarks matrix
construct-matrix-linux:
name: Construct Linux Benchmarks matrix
runs-on: ubuntu-latest
outputs:
benchmarks-matrix: '${{ steps.generate-matrix.outputs.benchmarks-matrix }}'
Expand Down Expand Up @@ -115,11 +146,115 @@ jobs:
MATRIX_LINUX_NIGHTLY_NEXT_ENABLED: ${{ inputs.linux_nightly_6_1_enabled && inputs.linux_nightly_next_enabled }}
MATRIX_LINUX_NIGHTLY_MAIN_ENABLED: ${{ inputs.linux_nightly_main_enabled }}

benchmarks:
name: Benchmarks
needs: construct-matrix
construct-matrix-macos:
name: Construct macOS Benchmarks matrix
runs-on: ubuntu-latest
outputs:
macos-matrix: '${{ steps.generate-matrix.outputs.macos-matrix }}'
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
persist-credentials: false
- id: generate-matrix
run: |
# Validate JSON environment variables
macos_env_vars_json='${{ inputs.macos_env_vars }}'

if ! echo "$macos_env_vars_json" | jq empty 2>/dev/null; then
echo "Error: macos_env_vars is not valid JSON"
exit 1
fi

runner_pool="${MACOS_RUNNER_POOL}"
xcode_16_3_enabled="${MACOS_XCODE_16_3_ENABLED}"
xcode_16_4_enabled="${MACOS_XCODE_16_4_ENABLED}"
xcode_26_0_enabled="${MACOS_XCODE_26_0_ENABLED}"
xcode_26_1_enabled="${MACOS_XCODE_26_1_ENABLED}"
xcode_latest_beta_enabled="${MACOS_XCODE_LATEST_BETA_ENABLED}"

# Create matrix from inputs
matrix='{"config": []}'

if [[ "$xcode_16_3_enabled" == "true" ]]; then
matrix=$(echo "$matrix" | jq -c \
--arg runner_pool "$runner_pool" \
--argjson env_vars "$macos_env_vars_json" \
'.config[.config| length] |= . + { "name": "macOS (Xcode 16.3)", "xcode_version": "16.3", "xcode_app": "Xcode_16.3.app", "os": "sequoia", "arch": "ARM64", "pool": $runner_pool, "env": $env_vars }')
fi

if [[ "$xcode_16_4_enabled" == "true" ]]; then
matrix=$(echo "$matrix" | jq -c \
--arg runner_pool "$runner_pool" \
--argjson env_vars "$macos_env_vars_json" \
'.config[.config| length] |= . + { "name": "macOS (Xcode 16.4)", "xcode_version": "16.4", "xcode_app": "Xcode_16.4.app", "os": "sequoia", "arch": "ARM64", "pool": $runner_pool, "env": $env_vars }')
fi

if [[ "$xcode_26_0_enabled" == "true" ]]; then
matrix=$(echo "$matrix" | jq -c \
--arg runner_pool "$runner_pool" \
--argjson env_vars "$macos_env_vars_json" \
'.config[.config| length] |= . + { "name": "macOS (Xcode 26.0)", "xcode_version": "26.0", "xcode_app": "Xcode_26.0.app", "os": "sequoia", "arch": "ARM64", "pool": $runner_pool, "env": $env_vars }')
fi

if [[ "$xcode_26_1_enabled" == "true" ]]; then
matrix=$(echo "$matrix" | jq -c \
--arg runner_pool "$runner_pool" \
--argjson env_vars "$macos_env_vars_json" \
'.config[.config| length] |= . + { "name": "macOS (Xcode 26.1)", "xcode_version": "26.1", "xcode_app": "Xcode_26.1.app", "os": "sequoia", "arch": "ARM64", "pool": $runner_pool, "env": $env_vars }')
fi

if [[ "$xcode_latest_beta_enabled" == "true" ]]; then
matrix=$(echo "$matrix" | jq -c \
--arg runner_pool "$runner_pool" \
--argjson env_vars "$macos_env_vars_json" \
'.config[.config| length] |= . + { "name": "macOS (Xcode latest beta)", "xcode_version": "latest beta", "xcode_app": "Xcode-latest.app", "os": "sequoia", "arch": "ARM64", "pool": $runner_pool, "env": $env_vars }')
fi

echo "macos-matrix=$matrix" >> "$GITHUB_OUTPUT"
env:
MACOS_RUNNER_POOL: ${{ inputs.macos_runner_pool }}
MACOS_XCODE_16_3_ENABLED: ${{ inputs.macos_xcode_16_3_enabled }}
MACOS_XCODE_16_4_ENABLED: ${{ inputs.macos_xcode_16_4_enabled }}
MACOS_XCODE_26_0_ENABLED: ${{ inputs.macos_xcode_26_0_enabled }}
MACOS_XCODE_26_1_ENABLED: ${{ inputs.macos_xcode_26_1_enabled }}
MACOS_XCODE_LATEST_BETA_ENABLED: ${{ inputs.macos_xcode_latest_beta_enabled }}

benchmarks-linux:
name: Linux Benchmarks
needs: construct-matrix-linux
# Workaround https://github.com/nektos/act/issues/1875
uses: apple/swift-nio/.github/workflows/swift_test_matrix.yml@main
with:
name: "Benchmarks"
matrix_string: '${{ needs.construct-matrix.outputs.benchmarks-matrix }}'
matrix_string: '${{ needs.construct-matrix-linux.outputs.benchmarks-matrix }}'

benchmarks-macos:
name: ${{ matrix.config.name }}
needs: construct-matrix-macos
runs-on: [self-hosted, macos, "${{ matrix.config.os }}", "${{ matrix.config.arch }}", "${{ matrix.config.pool }}"]
timeout-minutes: 30
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.construct-matrix-macos.outputs.macos-matrix) }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
persist-credentials: false
submodules: true
- name: Install jemalloc
run: |
brew install jemalloc
- name: Export environment variables
if: ${{ matrix.config.env != '' && matrix.config.env != '{}'}}
run: |
echo "Exporting environment variables from matrix configuration..."
echo '${{ toJSON(matrix.config.env) }}' | jq -r 'to_entries[] | "\(.key)=\(.value)"' >> $GITHUB_ENV
echo '${{ toJSON(matrix.config.env) }}' | jq -r 'to_entries[] | "exporting \(.key)=\(.value)"'
- name: Run benchmarks script
run: |
curl -s https://raw.githubusercontent.com/apple/swift-nio/main/scripts/check_benchmark_thresholds.sh | BENCHMARK_PACKAGE_PATH=${{ inputs.benchmark_package_path }} bash -s -- --disable-sandbox --allow-writing-to-package-directory
env:
DEVELOPER_DIR: "/Applications/${{ matrix.config.xcode_app }}"
SWIFT_VERSION: "Xcode ${{ matrix.config.xcode_version }}"