Skip to content
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

[SR-10654] fix @convention(thin) #53054

Open
weissi opened this issue May 10, 2019 · 3 comments
Open

[SR-10654] fix @convention(thin) #53054

weissi opened this issue May 10, 2019 · 3 comments
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself performance

Comments

@weissi
Copy link
Member

weissi commented May 10, 2019

Previous ID SR-10654
Radar rdar://problem/47446870
Original Reporter @weissi
Type Bug
Additional Detail from JIRA
Votes 1
Component/s Compiler
Labels Bug, Performance
Assignee None
Priority Medium

md5: ea8563aaed5377e6126d8a792b6ac7da

Issue Description:

@convention(thin) is often very useful in high-performance code (to save a word, and ARC traffic. Unfortunately @conventin(thin) doesn't actually work and apparently can lead to miscompiles.

We should fix it.

See here on why this is a useful construct in high-perf code: https://forums.swift.org/t/use-of-convention-thin-to-avoid-allocating-closures/12087

@ktoso
Copy link
Member

ktoso commented May 10, 2019

I view this as a way of achieving at declaration-site what https://bugs.swift.org/browse/SR-10653 achieves on use-site, allowing to make sure I won't close over things.

I agree with Johannes that knowing that I won't close over things is a tremendously useful thing in high performance code – esp. if closure heavy, though all the closures should be just pure functions from their input to some output (think streaming operators, stateful transformations (like "pure" map(), filter() or similar)).

@belkadan
Copy link
Contributor

cc @jckarter

@weissi
Copy link
Member Author

weissi commented Jul 2, 2019

@swift-ci create

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself performance
Projects
None yet
Development

No branches or pull requests

3 participants