-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[metadata prespecialization] Prespecialize common standard library types #31925
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
[metadata prespecialization] Prespecialize common standard library types #31925
Conversation
@swift-ci please test |
@swift-ci please benchmark |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Some of these won't result in prespecialization immediately (such as those involving existentials) but as the functionality gets brought up it they will.
Performance: -O
Code size: -OPerformance: -Osize
Code size: -OsizePerformance: -Onone
Code size: -swiftlibsHow 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 Noise: Sometimes the performance results (not code size!) contain false Hardware Overview
|
@swift-ci please test windows |
@swift-ci please test macOS |
Build failed |
@swift-ci please clean test os x platform |
@swift-ci please clean test macOS |
The standard library is already prespecializing types it uses within itself, but many commonly-used types aren't actually used by the standard library. This adds uses of these types to the std lib to force their prespecialization.
Note this list is not ABI. We can add and remove from it in each release. I generated this starter list by looking for types used by more than 1 app in a sample of a few Mac apps run on my desktop. We should eventually make resampling some representative programs to generate this list part of the Swift release process.
There are some types in this list we can't yet prespecialize (like those parameterized by non-nominal types or
AnyObject
) but I'm assuming those are coming so they're fine to keep in here.