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

Resolves #1923: Avoid copying continuation byte arrays by using ByteString internally #1924

Merged
merged 1 commit into from
Nov 21, 2022

Commits on Nov 21, 2022

  1. Resolves FoundationDB#1923: Avoid copying continuation byte arrays by…

    … using ByteString internally
    
    This updates the logic in the `RecordCursorContinuation` objects to avoid serializing a continuation all the way to a `byte[]` if it is not necessary. For example, when constructing protobuf objects that back continuations, child continuations can be constructed by calling `.toByteString()` on the continuation and passing that to the protobuf builder instead of serializing all the to a `byte[]` and then wrapping it back in a `ByteString`. This also makes sure that (as much as possible) the cursor implementations are more efficient when constructing a `ByteString`. For example, for the proto-based continuations, it should be able to return `.toByteString()` on the protobuf object instead of serializing the _protobuf_ all the way to a `byte[]` and then wrapping it back up, which some implementations did previously.
    
    Adopters who need a `ByteString` rather than a `byte[]` (for example, to pack the continuation into a protobuf) are also encouraged to switch to the newer method.
    
    This resolves FoundationDB#1923.
    alecgrieser committed Nov 21, 2022
    Configuration menu
    Copy the full SHA
    d7d0fe3 View commit details
    Browse the repository at this point in the history