You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This implementation of conversion from String to Data is in some cases 900x faster by taking advantage of fast paths. Ideally we should not drop performance like this on the floor and offer fast access to the appropriate backing storage. (note this is just a draft/toy version of what it should be but the concept should be implemented as API or SPI).
For reference, the (highly in flux) _StringGuts branch is exploring things like an internal `withMutableASCIIStorage` or `withMutableUTF16Storage` call backs. Those currently (because they're for mutation) necessitate conversion to native storage of the appropriate width, but we could also have a read-only view that would work for any contiguous String, whether native Swift or from Cocoa.
Additional Detail from JIRA
md5: 160572b7782ac20bbfdcd43f71047213
Issue Description:
This implementation of conversion from String to Data is in some cases 900x faster by taking advantage of fast paths. Ideally we should not drop performance like this on the floor and offer fast access to the appropriate backing storage. (note this is just a draft/toy version of what it should be but the concept should be implemented as API or SPI).
See the example at: https://gist.github.com/phausler/c6178bc9b0764f51d3ac182a293cede5
The text was updated successfully, but these errors were encountered: