-
Notifications
You must be signed in to change notification settings - Fork 10.6k
[stdlib] Set, Dictionary: Flatten switch statements #19611
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
|
@swift-ci please test |
|
@swift-ci please smoke benchmark |
This comment has been minimized.
This comment has been minimized.
|
Boo. I'll revert the read-only parts then. This may still be useful for mutations, though. Do we get any compilation benefit, though? @swift-ci please smoke test compiler performance |
|
Hm, actually, this seems to only slow down the _modify accessor of the Values view. That's an easy fix. I'll run some local benchmarks to see a bit more detail. |
|
Meanwhile I'm going to see if rebasing #18953 on top of this helps with that PR's regressions. |
The optimizer dislikes nested switch statements; flatten them out to simplify optimization and to hopefully speed things up a little.
9b2d653 to
77bf535
Compare
|
@swift-ci please smoke benchmark |
This comment has been minimized.
This comment has been minimized.
|
@swift-ci please smoke benchmark |
|
@swift-ci please smoke test compiler performance |
|
The swapAt slowdown was due to a bug in my uniqueness checks; it should be fixed now. |
Build comment file:Performance: -O
Code size: -O
Performance: -Osize
Code size: -Osize
Performance: -Onone
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 regressions before you merge the PR. Noise: Sometimes the performance results (not code size!) contain false alarms. Unexpected regressions which are marked with '(?)' are probably noise. If you see regressions which you cannot explain you can try to run the benchmarks again. If regressions still show up, please consult with the performance team (@eeckstein). Hardware Overview |
Build comment file:Summary for master smoketestUnexpected test results, excluded stats for Kingfisher, ReactiveCocoa No regressions above thresholds Debugdebug briefRegressed (0)
Improved (0)
Unchanged (delta < 1.0% or delta < 100.0ms) (3)
debug detailedRegressed (0)
Improved (0)
Unchanged (delta < 1.0% or delta < 100.0ms) (23)
Releaserelease briefRegressed (0)
Improved (0)
Unchanged (delta < 1.0% or delta < 100.0ms) (3)
release detailedRegressed (0)
Improved (0)
Unchanged (delta < 1.0% or delta < 100.0ms) (23)
|
|
This got superseded, right? |
|
@airspeedswift Yes; a simplified variant landed, and then #19688 switched Set/Dictionary from using enums to Bridge Objects anyway. Closing. |
The optimizer needs to work extra hard to process nested switch statements. Flatten them out to simplify optimization and to hopefully speed things up a little, especially around opaque stuff.