-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update Benchmark set up and persist benchmarks #180
Open
mimischi
wants to merge
7
commits into
swift-server:main
Choose a base branch
from
mimischi:persist-benchmark-thresholds
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 3 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
c2686df
Update Benchmark set up and persist benchmarks
mimischi 1197894
Address reviewer comment
mimischi cf7bfc4
Remove dangling `@main` from GH action
mimischi 55a58b2
Run consume loop 1000 times each
mimischi 415b7cb
Run `swift format`
mimischi 62ae8e2
Fix type typo
mimischi baa1e9e
Only measure `mallocCountTotal` in Benchmarks
mimischi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,45 @@ | ||
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 | ||
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,38 @@ | ||
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 | ||
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 | ||
} |
10 changes: 10 additions & 0 deletions
10
...5.9/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" : 88211455, | ||
"cpuTotal" : 40009727, | ||
"objectAllocCount" : 3471, | ||
"releaseCount" : 9175, | ||
"retainCount" : 4435, | ||
"retainReleaseDelta" : 1267, | ||
"throughput" : 9, | ||
"wallClock" : 130154495 | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In most of our repositories we only add benchmarks for
mallocCountTotal
because it is a stable measure. We don't yet have dedicated runners which would be required for time-based benchmarkssee e.g. https://github.com/apple/swift-nio/blob/main/Benchmarks/Thresholds/5.9/NIOCoreBenchmarks.NIOAsyncChannel.init.p90.json