-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[benchmark] Using tags for benchmarks #12242
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
Conversation
The idea being, we need to decide what benchmarks to run solely based on tags. `--tag` allows to list all tags that are required; `--skip-tags` allows to skip benchmarks that have any of those tags. By default, skip-tags list contains .unstable and .String, which results in the same subset of benchmarks as before.
@swift-ci Please smoke test |
@swift-ci Please smoke benchmark |
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 am not sure we want the new registerBenchmark
addition. Other than that LGTM! I love the addition of skip-tags / getting rid of run-all
benchmark/utils/main.swift
Outdated
_ tags: [BenchmarkCategory] | ||
) { | ||
registerBenchmark( | ||
BenchmarkInfo(name: name, runFunction: function, tags: tags)) |
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.
@atrick 's point with BenchmarkInfo is to slowly deprecate the 'main' file / migrate towards having the tags inside the benchmark's source file. replacing addTo with this runs counter to that.
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 think this change is fine. I just need to provide new instructions to the one person who was using --registered.
Build comment file:Optimized (O)Regression (3)
Improvement (6)
No Changes (320)
Added (4)
Unoptimized (Onone)Regression (3)
Improvement (3)
No Changes (323)
Added (4)
Hardware Overview
|
Awesome! Thanks. |
@swift-ci Please smoke test |
@swift-ci Please smoke benchmark |
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.
LGTM!
Hopefully the list of executed benchmarks will be the same ;-) |
@swift-ci Please smoke test Linux platform |
@swift-ci Please smoke benchmark |
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.
Quick drive by comments.
benchmark/utils/TestsUtils.swift
Outdated
@@ -65,6 +65,9 @@ public enum BenchmarkCategory : String { | |||
// reimplementing or call into code paths that have known opportunities for | |||
// significant optimization. | |||
case cpubench | |||
|
|||
// Explict skip marker |
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.
Explict => Explicit.
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.
Darn, I will have to rerun the tests =(
// | ||
// --skip-tags=array,set | ||
// | ||
// FIXME: If we used Error instead of .fail, then we could have a cleaner |
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 am fine if you want to use Error here. Really we just need a better argument parsing framework. I have one that is partially finished if you want to look at it. Or maybe once we have swiftpm we can just take one from a package.
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 copied that comment from a block above. Did not really pay much attention to what it says. But yeah, a general purpose arg parsing lib would be nice in many places.
@@ -107,9 +107,12 @@ struct TestConfig { | |||
/// The filters applied to our test names. | |||
var filters = [String]() | |||
|
|||
/// The tag that we want to run | |||
/// The tags that we want to run |
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.
Btw, one other thing that we could do to make this code even better is to use an OptionSet instead of a plain Set. I just forgot to make this change.
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.
Yeah. but for that the BenchmarkCategory
would have to become backed by an Int
, and I think there is some reliance on them being String
s.
Build comment file:Optimized (O)Regression (9)
Improvement (13)
No Changes (304)
Added (4)
Removed (3)
Unoptimized (Onone)Regression (4)
Improvement (9)
No Changes (313)
Added (4)
Removed (3)
Hardware Overview
|
Soo... It looks like we found a benchmark that was never executed =) |
No, seriously... |
@swift-ci Please clean test Linux platform |
Build failed |
@swift-ci Please smoke test macOS platform |
Introducing the skip-tags and moving all the benchmarks to using tags to decide which tests to run instead of manually splitting them into separate categories.