Closed a2 closed 7 years ago
We may improve support for Foundation.Data
, but as BSON uses [UInt8]
all over the place we won't be able to use this as the "native" data type without risking our performance. Also, [UInt8]
has been the standard pretty much since the beginning of server side open source Swift.
However, I don't really see why allocating a buffer of that size would freeze your web app? How are you allocating this byte array?
Currently I need to convert from
Foundation.Data
to[UInt8]
to insert some data into my BSON document. However, I need to allocate a ~300 kiB[UInt8]
buffer to store the data, and my web app freezes. Therefore I'm wondering if maybe the nativeData
type should be used to avoid this transformation, which I already see here.