[SR-12308] Storing Swift Array is slower than copying it manually to a new buffer #54738
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
performance
standard library
Area: Standard library umbrella
Environment
Xcode 11.4 Beta 2
Additional Detail from JIRA
md5: 7f2f36721c6e803dbbe482dc6bbad031
Issue Description:
I run into a case where storing a Swift Array seems to be slower than copying it over into an unsafe buffer.
In Instruments from those two snippets, the unsafe variant is around 200 ms faster on my machines (766 vs 556 ms). On top of that difference I have to actually copy array contents to an unsafe buffer. If there was a way to take ownership of the underlying array buffer I could avoid all those copies.
The text was updated successfully, but these errors were encountered: