-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Implement benchmark testing on Linux #16882
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
Implement benchmark testing on Linux #16882
Conversation
bbd108d
to
5a258a7
Compare
@swift-ci smoke test |
@swift-ci smoke benchmark |
Found a mistake... |
20239e1
to
7eba5f2
Compare
@swift-ci smoke test |
@swift-ci smoke benchmark |
@swift-ci smoke test |
@swift-ci smoke benchmark |
Build comment file:Build failed before running benchmark. |
@inline(__always) | ||
func getRandomBuf(_ arg: UnsafeMutableBufferPointer<UInt8>) { | ||
#if os(Linux) | ||
fatalError("Unsupported platform") |
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.
This can build if:
#if canImport(Glibc)
import Glibc
#endif
and:
#if canImport(Glibc)
getrandom(arg.baseAddress, arg.count, 0)
#elseif canImport(Darwin)
// arc4random_buf
#endif
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.
Ok.
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.
I can't do this exactly using canImport since this benchmark compiles in swift-3 mode. But I am going to do something similar.
] | ||
#endif | ||
|
||
private var dictionary: [NSString: NSString]! | ||
|
||
private func setup_DictionaryKeysContainsNative() { | ||
#if os(Linux) |
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.
These will be supported when #16736 lands.
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.
I figured.
I was able to run Benchmark_QuickCheck with the out of tree Linux build with just these tests disabled and everything seems to work. rdar://40541972
7eba5f2
to
ca330dd
Compare
@swift-ci smoke test |
@swift-ci python lint |
ca330dd
to
a3229c4
Compare
@swift-ci python lint |
@swift-ci smoke benchmark |
1 similar comment
@swift-ci smoke benchmark |
Build comment file:Build failed before running benchmark. |
@inline(__always) | ||
func getRandomBuf(baseAddress: UnsafeMutablePointer<UInt8>, count: Int) { | ||
#if os(Linux) | ||
getrandom(arg.baseAddress, arg.count, 0) |
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.
Now that arg is gone, this will error on Linux.
… on Linux. To use this, one needs to first build an installable root for swift (i.e. like the smoke testbot does). Then use the tool ./benchmark/scripts/build_linux.py with the appropriate locations of the build-directory, installable snapshot, and it will build the benchmarks. (There are more arguments, just use --help). rdar://40541972
a3229c4
to
36e0e69
Compare
Instead of defining your own logic for getting random, you can instead try using |
@Azoy This benchmark is written in swift-3 mode so that isn't available. Otherwise I would use it. Changing our benchmarks in this way would be a big jump that should be done in a different PR. |
@swift-ci smoke test |
@swift-ci smoke benchmark |
@swift-ci smoke test |
@swift-ci smoke benchmark |
Build comment file:Optimized (O)Regression (8)
Improvement (10)
No Changes (420)
Hardware Overview
|
Some notes:
rdar://40541972