Skip to content

Conversation

gottesmm
Copy link
Contributor

No description provided.

@gottesmm gottesmm requested a review from Catfish-Man February 26, 2020 02:36
@gottesmm
Copy link
Contributor Author

@swift-ci smoke test

@gottesmm
Copy link
Contributor Author

@Catfish-Man this one is pretty simple.

@karwa
Copy link
Contributor

karwa commented Feb 26, 2020

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.

@gottesmm
Copy link
Contributor Author

@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>
@gottesmm
Copy link
Contributor Author

@swift-ci smoke test

1 similar comment
@gottesmm
Copy link
Contributor Author

@swift-ci smoke test

@karwa
Copy link
Contributor

karwa commented Feb 26, 2020

@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

@gottesmm
Copy link
Contributor Author

@karwa well if you notice I am not suggesting that it be deprecated. These are just optimization tips.

@karwa
Copy link
Contributor

karwa commented Feb 26, 2020

@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.

@gottesmm
Copy link
Contributor Author

@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.

@gottesmm gottesmm merged commit 71fc5bd into swiftlang:master Feb 27, 2020
@gottesmm gottesmm deleted the pr-9b6505e3638b89a205f045c89db2e25914ac0349 branch February 27, 2020 00:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants