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

Performance improvements for Blob #416

Closed

Conversation

robertjpayne
Copy link

@robertjpayne robertjpayne commented Apr 21, 2016

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?

@robertjpayne
Copy link
Author

Not sure what's up with Travis, it's pulling an old commit that I squashed.

@jberkel jberkel added this to the 0.12.0 milestone Sep 28, 2017
@jberkel jberkel modified the milestones: 0.12.0, 0.13.1 Aug 23, 2021
@jberkel
Copy link
Collaborator

jberkel commented Aug 25, 2021

Looks like a worthwhile change, but breaking API compatibility (public let bytes: [UInt8]), so maybe something to consider for the next major release.

@jberkel jberkel modified the milestones: 0.13.1, 0.13.2 Nov 17, 2021
@jberkel jberkel modified the milestones: 0.14.0, 0.14.1 Jul 17, 2022
jberkel added a commit that referenced this pull request Oct 23, 2022
@jberkel
Copy link
Collaborator

jberkel commented Oct 23, 2022

Replaced w/ #1167

@jberkel jberkel closed this Oct 23, 2022
@jberkel jberkel mentioned this pull request Nov 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants