-
Notifications
You must be signed in to change notification settings - Fork 10.2k
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
[DNM] [stdlib] Performance improvements for reading keypaths #70451
base: main
Are you sure you want to change the base?
Conversation
@swift-ci please smoke test |
@swift-ci please benchmark |
@swift-ci please benchmark Apple Silicon |
@swift-ci please smoke test |
@swift-ci please benchmark Apple Silicon |
@swift-ci please benchmark |
@swift-ci please smoke test |
@swift-ci please benchmark |
@swift-ci please test |
@swift-ci please build macOS toolchain |
@phausler Should it be "please build toolchain macOS"? Or just "please build toolchain"? I'm not seeing anything in the CI queue. |
@swift-ci please build toolchain |
@swift-ci build toolchain |
@stephencelis sorry for the late reply, I tried out the code snippet you linked with this change and it still crashes at runtime. I think this is the compiler doing something incorrectly perhaps, but maybe it's in the keypath appending logic. I'll take a closer look. |
e381555
to
3b0a35d
Compare
@swift-ci please test |
3b0a35d
to
1ca08c1
Compare
This patch includes some performance improvements for reading out a value from a key path. Essentially I've cut out all metadata allocations within the projection loop as well as getting rid of the intermediate
Any
value we were using to traffic intermediate values. Instead, we calculate the largest type we'll ever store during instantiation and stuff that value at the end of the buffer. We'll read this value when we project and create a temporary allocation and constantly re-view this memory for components.Partially resolves: rdar://116587442