-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update Benchmark set up and persist benchmarks
We have recently updated our toolchain version to 5.9, but have never updated the benchmark suite to use 5.9 or newer. Also, it does not look like we ever commited a baseline to this repository. While at it, wiring up GitHub actions to run the benchmarks for every pull request, as well as on a merge into `main`. Re-uses a lot of the heavy lifting that was defined in `apple/swift-nio` already. Note that `nightly-main` appears broken at the moment. The Benchmark tool gets stuck, and initial debugging point to it never finishing `_sendAndAcknowledgeMessages` when producing a set of messages before every benchmark.
- Loading branch information
Showing
33 changed files
with
458 additions
and
134 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
name: Benchmarks | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
benchmark_package_path: | ||
type: string | ||
description: "Path to the directory containing the benchmarking package. Defaults to ." | ||
default: "." | ||
swift_package_arguments: | ||
type: string | ||
description: "Arguments to the switch package command invocation e.g. `--disable-sandbox`" | ||
linux_5_9_enabled: | ||
type: boolean | ||
description: "Boolean to enable the Linux 5.9 Swift version matrix job. Defaults to true." | ||
default: true | ||
linux_5_10_enabled: | ||
type: boolean | ||
description: "Boolean to enable the Linux 5.10 Swift version matrix job. Defaults to true." | ||
default: true | ||
linux_6_0_enabled: | ||
type: boolean | ||
description: "Boolean to enable the Linux 6.0 Swift version matrix job. Defaults to true." | ||
default: true | ||
linux_nightly_6_0_enabled: | ||
type: boolean | ||
description: "Boolean to enable the Linux nightly 6.0 Swift version matrix job. Defaults to true." | ||
default: true | ||
linux_nightly_main_enabled: | ||
type: boolean | ||
description: "Boolean to enable the Linux nightly main Swift version matrix job. Defaults to true." | ||
default: true | ||
|
||
jobs: | ||
benchmarks: | ||
name: Benchmarks | ||
# Workaround https://github.com/nektos/act/issues/1875 | ||
uses: ./.github/workflows/swift_matrix.yml | ||
with: | ||
name: "Benchmarks" | ||
matrix_linux_command: "apt-get update -y -q && apt-get install -y -q libjemalloc-dev && apt-get -y install libsasl2-dev && swift package --package-path ${{ inputs.benchmark_package_path }} ${{ inputs.swift_package_arguments }} benchmark baseline check --check-absolute-path ${{ inputs.benchmark_package_path }}/Thresholds/${SWIFT_VERSION}/" | ||
matrix_linux_5_9_enabled: ${{ inputs.linux_5_9_enabled }} | ||
matrix_linux_5_10_enabled: ${{ inputs.linux_5_10_enabled }} | ||
matrix_linux_6_0_enabled: ${{ inputs.linux_6_0_enabled }} | ||
matrix_linux_nightly_6_0_enabled: ${{ inputs.linux_nightly_6_0_enabled }} | ||
matrix_linux_nightly_main_enabled: ${{ inputs.linux_nightly_main_enabled }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: Cxx interop | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
linux_5_9_enabled: | ||
type: boolean | ||
description: "Boolean to enable the Linux 5.9 Swift version matrix job. Defaults to true." | ||
default: true | ||
linux_5_10_enabled: | ||
type: boolean | ||
description: "Boolean to enable the Linux 5.10 Swift version matrix job. Defaults to true." | ||
default: true | ||
linux_6_0_enabled: | ||
type: boolean | ||
description: "Boolean to enable the Linux 6.0 Swift version matrix job. Defaults to true." | ||
default: true | ||
linux_nightly_6_0_enabled: | ||
type: boolean | ||
description: "Boolean to enable the Linux nightly 6.0 Swift version matrix job. Defaults to true." | ||
default: true | ||
linux_nightly_main_enabled: | ||
type: boolean | ||
description: "Boolean to enable the Linux nightly main Swift version matrix job. Defaults to true." | ||
default: true | ||
|
||
jobs: | ||
cxx-interop: | ||
name: Cxx interop | ||
# Workaround https://github.com/nektos/act/issues/1875 | ||
uses: ./.github/workflows/swift_matrix.yml | ||
with: | ||
name: "Cxx interop" | ||
matrix_linux_command: "apt-get update -y -q && apt-get install -y -q jq && apt-get -y install libsasl2-dev && curl -s https://raw.githubusercontent.com/apple/swift-nio/main/scripts/check-cxx-interop-compatibility.sh | bash" | ||
matrix_linux_5_9_enabled: ${{ inputs.linux_5_9_enabled }} | ||
matrix_linux_5_10_enabled: ${{ inputs.linux_5_10_enabled }} | ||
matrix_linux_6_0_enabled: ${{ inputs.linux_6_0_enabled }} | ||
matrix_linux_nightly_6_0_enabled: ${{ inputs.linux_nightly_6_0_enabled }} | ||
matrix_linux_nightly_main_enabled: ${{ inputs.linux_nightly_main_enabled }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,133 @@ | ||
name: Matrix | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
name: | ||
type: string | ||
description: "The name of the workflow used for the concurrency group." | ||
required: true | ||
matrix_linux_command: | ||
type: string | ||
description: "The command of the current Swift version linux matrix job to execute." | ||
required: true | ||
matrix_linux_5_9_enabled: | ||
type: boolean | ||
description: "Boolean to enable the 5.9 Swift version matrix job. Defaults to true." | ||
default: true | ||
matrix_linux_5_9_container_image: | ||
type: string | ||
description: "Container image for the 5.9 Swift version matrix job. Defaults to matching Swift Ubuntu image." | ||
default: "swift:5.9-jammy" | ||
matrix_linux_5_9_command_override: | ||
type: string | ||
description: "The command of the 5.9 Swift version linux matrix job to execute." | ||
matrix_linux_5_10_enabled: | ||
type: boolean | ||
description: "Boolean to enable the 5.10 Swift version matrix job. Defaults to true." | ||
default: true | ||
matrix_linux_5_10_container_image: | ||
type: string | ||
description: "Container image for the 5.10 Swift version matrix job. Defaults to matching Swift Ubuntu image." | ||
default: "swift:5.10-jammy" | ||
matrix_linux_5_10_command_override: | ||
type: string | ||
description: "The command of the 5.10 Swift version linux matrix job to execute." | ||
matrix_linux_6_0_enabled: | ||
type: boolean | ||
description: "Boolean to enable the 6.0 Swift version matrix job. Defaults to true." | ||
default: true | ||
matrix_linux_6_0_container_image: | ||
type: string | ||
description: "Container image for the 6.0 Swift version matrix job. Defaults to matching Swift Ubuntu image." | ||
default: "swift:6.0-jammy" | ||
matrix_linux_6_0_command_override: | ||
type: string | ||
description: "The command of the 6.0 Swift version linux matrix job to execute." | ||
matrix_linux_nightly_6_0_enabled: | ||
type: boolean | ||
description: "Boolean to enable the nightly 6.0 Swift version matrix job. Defaults to true." | ||
default: true | ||
matrix_linux_nightly_6_0_container_image: | ||
type: string | ||
description: "Container image for the nightly 6.0 Swift version matrix job. Defaults to matching Swift Ubuntu image." | ||
default: "swiftlang/swift:nightly-6.0-jammy" | ||
matrix_linux_nightly_6_0_command_override: | ||
type: string | ||
description: "The command of the nightly 6.0 Swift version linux matrix job to execute." | ||
matrix_linux_nightly_main_enabled: | ||
type: boolean | ||
description: "Boolean to enable the nightly main Swift version matrix job. Defaults to true." | ||
default: true | ||
matrix_linux_nightly_main_container_image: | ||
type: string | ||
description: "Container image for the nightly main Swift version matrix job. Defaults to matching Swift Ubuntu image." | ||
default: "swiftlang/swift:nightly-main-jammy" | ||
matrix_linux_nightly_main_command_override: | ||
type: string | ||
description: "The command of the nightly main Swift version linux matrix job to execute." | ||
|
||
# We are cancelling previously triggered workflow runs | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }}-${{ inputs.name }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
linux: | ||
name: Linux (${{ matrix.swift.swift_version }}) | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
# We are specifying only the major and minor of the docker images to automatically pick up the latest patch release | ||
swift: | ||
- image: ${{ inputs.matrix_linux_5_9_container_image }} | ||
swift_version: "5.9" | ||
enabled: ${{ inputs.matrix_linux_5_9_enabled }} | ||
- image: ${{ inputs.matrix_linux_5_10_container_image }} | ||
swift_version: "5.10" | ||
enabled: ${{ inputs.matrix_linux_5_10_enabled }} | ||
- image: ${{ inputs.matrix_linux_6_0_container_image }} | ||
swift_version: "6.0" | ||
enabled: ${{ inputs.matrix_linux_6_0_enabled }} | ||
- image: ${{ inputs.matrix_linux_nightly_6_0_container_image }} | ||
swift_version: "nightly-6.0" | ||
enabled: ${{ inputs.matrix_linux_nightly_6_0_enabled }} | ||
- image: ${{ inputs.matrix_linux_nightly_main_container_image }} | ||
swift_version: "nightly-main" | ||
enabled: ${{ inputs.matrix_linux_nightly_main_enabled }} | ||
container: | ||
image: ${{ matrix.swift.image }} | ||
steps: | ||
- name: Checkout repository | ||
if: ${{ matrix.swift.enabled }} | ||
uses: actions/checkout@v4 | ||
with: | ||
persist-credentials: false | ||
submodules: true | ||
- name: Mark the workspace as safe | ||
if: ${{ matrix.swift.enabled }} | ||
# https://github.com/actions/checkout/issues/766 | ||
run: git config --global --add safe.directory ${GITHUB_WORKSPACE} | ||
- name: Run matrix job | ||
if: ${{ matrix.swift.enabled }} | ||
env: | ||
SWIFT_VERSION: ${{ matrix.swift.swift_version }} | ||
COMMAND: ${{ inputs.matrix_linux_command }} | ||
COMMAND_OVERRIDE_5_9: ${{ inputs.matrix_linux_5_9_command_override }} | ||
COMMAND_OVERRIDE_5_10: ${{ inputs.matrix_linux_5_10_command_override }} | ||
COMMAND_OVERRIDE_6_0: ${{ inputs.matrix_linux_6_0_command_override }} | ||
COMMAND_OVERRIDE_NIGHTLY_6_0: ${{ inputs.matrix_linux_nightly_6_0_command_override }} | ||
COMMAND_OVERRIDE_NIGHTLY_MAIN: ${{ inputs.matrix_linux_nightly_main_command_override }} | ||
run: | | ||
apt-get -qq update && apt-get -qq -y install curl && apt-get -y install libsasl2-dev | ||
curl -s https://raw.githubusercontent.com/apple/swift-nio/main/scripts/check-matrix-job.sh | bash | ||
services: | ||
zookeeper: | ||
image: ubuntu/zookeeper | ||
kafka: | ||
image: ubuntu/kafka | ||
env: | ||
ZOOKEEPER_HOST: zookeeper | ||
env: | ||
KAFKA_HOST: kafka |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
....10/SwiftKafkaConsumerBenchmarks.SwiftKafkaConsumer_basic_consumer_messages_1000.p90.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"allocatedResidentMemory" : 77266944, | ||
"cpuTotal" : 200000000, | ||
"objectAllocCount" : 5549, | ||
"releaseCount" : 15168, | ||
"retainCount" : 7108, | ||
"retainReleaseDelta" : 2511, | ||
"throughput" : 2, | ||
"wallClock" : 695307500 | ||
} |
3 changes: 3 additions & 0 deletions
3
...SwiftKafkaConsumerBenchmarks.SwiftKafkaConsumer_with_offset_commit_messages_1000.p90.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
|
||
} |
10 changes: 10 additions & 0 deletions
10
...sholds/5.10/SwiftKafkaConsumerBenchmarks.librdkafka_basic_consumer_messages_1000.p90.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"allocatedResidentMemory" : 47382528, | ||
"cpuTotal" : 10000000, | ||
"objectAllocCount" : 16, | ||
"releaseCount" : 48, | ||
"retainCount" : 2, | ||
"retainReleaseDelta" : 30, | ||
"throughput" : 2, | ||
"wallClock" : 640572501 | ||
} |
10 changes: 10 additions & 0 deletions
10
...ds/5.10/SwiftKafkaConsumerBenchmarks.librdkafka_with_offset_commit_messages_1000.p90.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"allocatedResidentMemory" : 44204031, | ||
"cpuTotal" : 80000000, | ||
"objectAllocCount" : 16, | ||
"releaseCount" : 48, | ||
"retainCount" : 2, | ||
"retainReleaseDelta" : 30, | ||
"throughput" : 3, | ||
"wallClock" : 320339967 | ||
} |
Oops, something went wrong.