Performance improvements for Blob
We use Blobs a lot in our database and find the current API to not allow much performance tuning. This pull request address this by:
- Blobs are now a class reference type rather than a value type so it's internal bytes are never copied.
- Blobs are backed by a NSData object rather than a byte array. This has a huge benefit when bridging between NSData to Blob and Blob to NSData.
There should be no impact on existing code. The swift-corelibs project contains a working NSData implementation for Linux so I can't see why we shouldn't use NSData.
The only pitfall I can see is if a user grabs a Blob from a NSMutableData object, I could potentially put some checks in place for this?
Not sure what's up with Travis, it's pulling an old commit that I squashed.
Looks like a worthwhile change, but breaking API compatibility (public let bytes: [UInt8]), so maybe something to consider for the next major release.
Replaced w/ #1167