-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[benchmark] Add benchmarks for IndexPath's subscripts, max, min #34535
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
Add benchmarks for subscripts, max, min
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.
Just some additional clarifications on formatting. If you configure swift-format with "lineLength": 80
, "indentation": { "spaces": 2 }
, and "prioritizeKeepingFunctionOutputTogether": true
, that should get you pretty close.
@swift-ci Please benchmark |
Performance: -O
Code size: -O
Performance: -Osize
Code size: -OsizePerformance: -Onone
Code size: -swiftlibs
How to read the dataThe tables contain differences in performance which are larger than 8% and differences in code size which are larger than 1%.If you see any unexpected regressions, you should consider fixing the Noise: Sometimes the performance results (not code size!) contain false Hardware Overview
|
Going to address these results. |
Fixes mem usage of run_IndexPathSubscriptRangeMutation
Hopefully fixed those issues now. I ran my changes locally and got improved numbers. |
As a general comment: we should try to keep the number of benchmarks to a minimum (while still testing what we want to test). Adding a full set of permutations for each language feature would just explode the benchmark run time. You are not adding too many benchmarks here, but maybe you can still extract a representative set out of these 8 benchmarks - or test several variations in a single benchmark. |
Thanks for the pointers. I opted to test several variations in a single benchmark. Let me know what you think :) |
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.
Basically LGTM.
Just a few minor comments.
Cool. Fixed! |
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, thanks!
@swift-ci benchmark |
@swift-ci smoke test |
Performance: -O
Code size: -O
Performance: -Osize
Code size: -OsizePerformance: -Onone
Code size: -swiftlibs
How to read the dataThe tables contain differences in performance which are larger than 8% and differences in code size which are larger than 1%.If you see any unexpected regressions, you should consider fixing the Noise: Sometimes the performance results (not code size!) contain false Hardware Overview
|
Build failed before running benchmark. |
Adds IndexPath benchmarks for the following, and is part of SR-6789:
subscript(_:IndexPath.Index)
subscript(_:Range<IndexPath.Index>)
max()
min()
These are the added benchmarks:
IndexPathSubscriptMutation
: Increments an element at the given index by 1.IndexPathSubscriptRangeMutation
: Adds an IndexPath to the given index range.IndexPathMaxBeginning
: Checks max(), with the max value at the beginning.IndexPathMaxMiddle
: Checks max(), with the max value at the middle.IndexPathMaxEnd
: Checks max(), with the max value at the end.IndexPathMinBeginning
: Checks min(), with the min value at the beginning.IndexPathMinMiddle
: Checks min(), with the min value at the middle.IndexPathMinEnd
: Checks min(), with the min value at the endThis is my first contribution; open to any comments!
Resolves SR-13801