-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[opt-tips] Remove -Ounchecked and talk about WMO + 'internal' to reduce dynamic dispatch. #30068
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
[opt-tips] Remove -Ounchecked and talk about WMO + 'internal' to reduce dynamic dispatch. #30068
Conversation
@swift-ci smoke test |
@Catfish-Man this one is pretty simple. |
Is -Ounchecked being removed?!? It’s quite useful for removing things like collection bounds-checking in situations where you can guarantee indexes will always be valid. |
@karwa It is IMO a benchmarking mode that shouldn't really b e used out side of that context. We definitely I don't think want to encourage people to use it. |
Co-Authored-By: Brennan Saeta <brennan.saeta@gmail.com>
@swift-ci smoke test |
1 similar comment
@swift-ci smoke test |
@gottesmm It is documented in lots of places, including the standard library‘s documentation: https://developer.apple.com/documentation/swift/1540960-precondition Deprecating it was suggested once before, but both Ted and Chris agreed that it would need to go through evolution: https://forums.swift.org/t/deprecating-ounchecked/6928/20 |
@karwa well if you notice I am not suggesting that it be deprecated. These are just optimization tips. |
@gottesmm I understand, but the tips are there for swift users to better understand the available options, right? So given that the mode exists, it makes sense to keep the documentation. Otherwise, users might not understand the caveats and over-use it. Maybe add a bigger warning if you don’t think the existing one isn’t clear enough, but I don’t see any justification to just not document what it does. It’s a supported feature. |
@karwa This document is not meant to document optimization options. It is meant to provide tips/directions for improving performance when using standard work flows. Just b/c the project is not deprecating -Ounchecked (where deprecation means giving notice that -Ounchecked will be removed in a future version of swift) doesn't mean that the project should actively push people towards -Ounchecked and suggest people use -Ounchecked. By putting -Ounchecked in this document, we are doing exactly that. |
No description provided.