-
Notifications
You must be signed in to change notification settings - Fork 652
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
Dn loop bound box benchmark #2778
Open
dnadoba
wants to merge
14
commits into
apple:main
Choose a base branch
from
dnadoba:dn-loop-bound-box-benchmark
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 5 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
33e3a55
Add NIOLoopBoundBox benchmark
dnadoba 3842f7c
run `./dev/update-benchmark-thresholds.sh`
dnadoba 7927b1f
Merge branch 'main' into dn-loop-bound-box-benchmark
dnadoba 6bc8978
run CI again
dnadoba 90863cb
Merge branch 'dn-loop-bound-box-benchmark' of github.com:dnadoba/swif…
dnadoba a87b349
Merge branch 'main' into dn-loop-bound-box-benchmark
dnadoba 05ab847
Update benchmark loop
dnadoba d14d7a9
Fix benchmark thresholds update script
FranzBusch 014e903
Merge branch 'fb-benchmark-update-thresholds' into dn-loop-bound-box-…
dnadoba 1dd1710
run `./dev/update-benchmark-thresholds.sh`
dnadoba e9b71b7
Remove inner loop
dnadoba 4b4181b
Merge branch 'main' into dn-loop-bound-box-benchmark
dnadoba b25527a
run ./dev/update-benchmark-thresholds.sh
dnadoba 986dc2e
run ./dev/update-benchmark-thresholds.sh again
dnadoba 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
29 changes: 29 additions & 0 deletions
29
Benchmarks/Benchmarks/NIOCoreBenchmarks/NIOLoopBoundBox.swift
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,29 @@ | ||
//===----------------------------------------------------------------------===// | ||
// | ||
// This source file is part of the SwiftNIO open source project | ||
// | ||
// Copyright (c) 2024 Apple Inc. and the SwiftNIO project authors | ||
// Licensed under Apache License v2.0 | ||
// | ||
// See LICENSE.txt for license information | ||
// See CONTRIBUTORS.txt for the list of SwiftNIO project authors | ||
// | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
import NIOCore | ||
import NIOEmbedded | ||
|
||
func runNIOLoopBoundBoxInPlaceMutation() { | ||
let embeddedEventLoop = EmbeddedEventLoop() | ||
let boundBox = NIOLoopBoundBox([Int](), eventLoop: embeddedEventLoop) | ||
boundBox.value.reserveCapacity(1000) | ||
|
||
for i in 0..<1000 { | ||
boundBox.value.append(i) | ||
} | ||
|
||
precondition(boundBox.value.count == 1000) | ||
precondition(boundBox.value.reduce(0, +) == 499500) | ||
} |
2 changes: 1 addition & 1 deletion
2
Benchmarks/Thresholds/5.10/NIOCoreBenchmarks.NIOAsyncChannel.init.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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"mallocCountTotal" : 12 | ||
} | ||
} |
3 changes: 3 additions & 0 deletions
3
Benchmarks/Thresholds/5.10/NIOCoreBenchmarks.NIOLoopBoundBox.value.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 @@ | ||
{ | ||
"mallocCountTotal" : 1 | ||
} |
4 changes: 2 additions & 2 deletions
4
Benchmarks/Thresholds/5.10/NIOPosixBenchmarks.TCPEcho.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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"mallocCountTotal" : 108 | ||
} | ||
"mallocCountTotal" : 90 | ||
} |
4 changes: 2 additions & 2 deletions
4
Benchmarks/Thresholds/5.10/NIOPosixBenchmarks.TCPEchoAsyncChannel.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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"mallocCountTotal" : 165000 | ||
} | ||
"mallocCountTotal" : 164212 | ||
} |
2 changes: 1 addition & 1 deletion
2
Benchmarks/Thresholds/5.8/NIOCoreBenchmarks.NIOAsyncChannel.init.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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"mallocCountTotal" : 12 | ||
} | ||
} |
3 changes: 3 additions & 0 deletions
3
Benchmarks/Thresholds/5.8/NIOCoreBenchmarks.NIOLoopBoundBox.value.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 @@ | ||
{ | ||
"mallocCountTotal" : 2 | ||
} |
4 changes: 2 additions & 2 deletions
4
Benchmarks/Thresholds/5.8/NIOPosixBenchmarks.TCPEcho.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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"mallocCountTotal" : 110 | ||
} | ||
"mallocCountTotal" : 92 | ||
} |
2 changes: 1 addition & 1 deletion
2
Benchmarks/Thresholds/5.9/NIOCoreBenchmarks.NIOAsyncChannel.init.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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"mallocCountTotal" : 12 | ||
} | ||
} |
3 changes: 3 additions & 0 deletions
3
Benchmarks/Thresholds/5.9/NIOCoreBenchmarks.NIOLoopBoundBox.value.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 @@ | ||
{ | ||
"mallocCountTotal" : 2 | ||
} |
4 changes: 2 additions & 2 deletions
4
Benchmarks/Thresholds/5.9/NIOPosixBenchmarks.TCPEcho.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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"mallocCountTotal" : 110 | ||
} | ||
"mallocCountTotal" : 92 | ||
} |
4 changes: 2 additions & 2 deletions
4
Benchmarks/Thresholds/5.9/NIOPosixBenchmarks.TCPEchoAsyncChannel.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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"mallocCountTotal" : 164000 | ||
} | ||
"mallocCountTotal" : 164222 | ||
} |
2 changes: 1 addition & 1 deletion
2
Benchmarks/Thresholds/main/NIOCoreBenchmarks.NIOAsyncChannel.init.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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"mallocCountTotal" : 12 | ||
} | ||
} |
3 changes: 3 additions & 0 deletions
3
Benchmarks/Thresholds/main/NIOCoreBenchmarks.NIOLoopBoundBox.value.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 @@ | ||
{ | ||
"mallocCountTotal" : 1 | ||
} |
4 changes: 2 additions & 2 deletions
4
Benchmarks/Thresholds/main/NIOPosixBenchmarks.TCPEcho.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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"mallocCountTotal" : 108 | ||
} | ||
"mallocCountTotal" : 90 | ||
} |
4 changes: 2 additions & 2 deletions
4
Benchmarks/Thresholds/main/NIOPosixBenchmarks.TCPEchoAsyncChannel.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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"mallocCountTotal" : 165000 | ||
} | ||
"mallocCountTotal" : 164104 | ||
} |
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
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.
Can we run this multiple times, for the scaling factor? Ideally we’d only count allocations in the loop body, as we’re otherwise very sensitive to the runtime.
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.
Done. This breaks the benchmarking comparison tool as it now thinks we have improved by 0% instead of 100% 😆
@hassila is this a known issue?
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.
Hmm, it seems it is normalizing to the slower benchmark instead of the reverse - looks like a plain bug but don't think we've got a case for it - out of office until August so will be a while before I can have a proper look. If you can, file a case would be great - otherwise I'll pick it up when back.
I would suggest using a scaling factor for your bench mark though and pass it on instead to the function - that way you can get normalized numbers per subiteration