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-14982] UnsafeMutableRawBufferPointer.initialize(as:from: ) has no fast path for contiguous Collections #57324

Open
glessard opened this issue Jul 27, 2021 · 4 comments

Comments

@glessard
Copy link
Contributor

glessard commented Jul 27, 2021

Previous ID SR-14982
Radar rdar://problem/81168547
Original Reporter @glessard
Type Improvement
Additional Detail from JIRA
Votes 0
Component/s Standard Library
Labels Improvement, Performance
Assignee @glessard
Priority Medium

md5: 604b61efa14e93fd1f56dd2bcf00a48f

Issue Description:

UMRBP.initializeMemory<T,S>(as type: T.Type, from source: S) takes a Sequence and and initializes an UMRBP element-by-element (see here). Note that the closest equivalent function on UnsafeMutableRawPointer is the most likely way to add a fast-path for this, by using withContiguousStorageIfAvailable on source.

Adding a fast path may require adding an overload.

@glessard
Copy link
Contributor Author

glessard commented Jul 27, 2021

UMRP isn't the only way to fast-path this: UMBP<T>.initialize(from: ) is also viable, and might work for more Collection types.

@glessard
Copy link
Contributor Author

glessard commented Jul 27, 2021

@swift-ci create

@glessard
Copy link
Contributor Author

glessard commented Jul 27, 2021

(this is thematically related to [SR-14886| https://bugs.swift.org/browse/SR-14886])

@glessard
Copy link
Contributor Author

glessard commented Aug 10, 2021

#38817

@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
Projects
None yet
Development

No branches or pull requests

1 participant