-
Notifications
You must be signed in to change notification settings - Fork 440
Add performance measurement test with instructions count #1863
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
Add performance measurement test with instructions count #1863
Conversation
e065080
to
c3eb411
Compare
AFAIK that’s a known issue that we can’t define baselines when running XCTest using The baseline file could then look as follows: {
"testNativeParsingPerformance": 5850081534,
...
} and func measureInstructions(_ baselineName: StaticString = #function) |
c7365a5
to
ba3e70e
Compare
@ahoppen did you think of something like this? I'm not sure I understand this
|
@swift-ci please test |
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.
Very nice.
One thought that just crossed my mind: I think it’s a little bit frustrating if all performance tests fail if no baseline file is provided because this means that if you check out the repo and run tests initially, you’ll see test failures. Because of this, what do you think about changing it so that if PerformanceTest/baselines.json
doesn’t exist, all performance tests pass. Once you do care about performance, you’ll create a baselines.json
and all performance tests for which you don’t have baselines will start failing, which might make sense.
531088a
to
7ebe7f3
Compare
@swift-ci please test |
7ebe7f3
to
2d0a54f
Compare
@swift-ci please test |
2d0a54f
to
115d33a
Compare
@swift-ci please test |
115d33a
to
be475f6
Compare
@swift-ci please test |
be475f6
to
7187539
Compare
@swift-ci please test |
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.
Nice 🤩
a318c95
to
3ff99b9
Compare
@swift-ci please test Baseline {
"testNativeParsingPerformance": 311011168,
"testClassifierPerformance": 2624475912,
"testEmptyVisitorPerformance": 48502831,
"testEmptyRewriterPerformance": 54438776,
"testEmptyAnyVisitorPerformance": 49123765
} Failed 1.29017% difference |
@swift-ci please test windows |
3ff99b9
to
a5d3c42
Compare
@swift-ci please test |
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.
Looks like we need to increase the allowed deviation to 1%.
ee0f2ae
to
a185b56
Compare
@swift-ci please test |
Oh, we should only specify the baseline if we are running on macOS. if platform.system() == "Darwin": |
a185b56
to
b07bcdb
Compare
@swift-ci please test |
2/3 @swift-ci please test |
3/3 @swift-ci please test |
As we talked about, it would be nice to have performance tests as part of the CI.
I did dig a bit into
XCTCPUMetric
.But I didn't find a nice way to add baselines.
So I tried to make my own measure method so we easily could start adding them in the code