Skip to content

[4.2] Two @inlinable rawValue optimizations #16082

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

jrose-apple
Copy link
Contributor

Small optimizations that just missed the branch (#16043 and #15589), both reviewed by @slavapestov. We still have more work to do on the original bug SR-7094, and I also filed some extra Radars to discuss whether to expand this to more synthesized declarations.

…ftlang#16043)

The compiler can synthesize these, but it doesn't mark them
@inlinable, since in the general case they're just a "default"
implementation and not "the only implementation forever". But for a
two-element enum that's based on a part of IEEE 754, it's probably
safe to assume this is the only implementation forever, and that
can be important for performance.

https://bugs.swift.org/browse/SR-7094
(cherry picked from commit f6b67f3)
…ms (swiftlang#15589)

Small potential perf win...or rather regain, since we apparently used
to do this. It's a bit trickier to say whether we should do the same
for resilient enums, since /in theory/ a later version of the library
might decide to use different raw values.

https://bugs.swift.org/browse/SR-7094
(cherry picked from commit 766acd4)
@jrose-apple jrose-apple changed the title @inlinable rawValue optimizations [4.2] Two @inlinable rawValue optimizations Apr 21, 2018
@jrose-apple
Copy link
Contributor Author

@swift-ci Please test

@jrose-apple jrose-apple merged commit ac38f00 into swiftlang:swift-4.2-branch Apr 30, 2018
@jrose-apple jrose-apple deleted the 4.2-inlinable-rawValue-optimizations branch April 30, 2018 20:33
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.

1 participant