Skip to content

Conversation

@wchargin
Copy link
Contributor

@wchargin wchargin commented Feb 9, 2021

Summary:
The bytes crate provides facilitates zero-copy network programming
with the Bytes struct, which is a kind of “Arc<[u8]> on steroids”
that can be sliced and passed around with shared ownership. Other parts
of our stack already use Bytes (notably, tonic, reqwest, and
prost), so by using it ourselves we can remove some unnecessary
clones, as discussed in review on #4646. Since this already exists as
a transitive dep, this patch just exposes it for direct use by our code.

Test Plan:
It builds: bazel build //tensorboard/data/server/cargo:bytes.

wchargin-branch: rust-dep-bytes

Summary:
The [`bytes`] crate provides facilitates zero-copy network programming
with the `Bytes` struct, which is a kind of “`Arc<[u8]>` on steroids”
that can be sliced and passed around with shared ownership. Other parts
of our stack already use `Bytes` (notably, `tonic`, `reqwest`, and
`prost`), so by using it ourselves we can remove some unnecessary
clones, as discussed in [review on #4646]. Since this already exists as
a transitive dep, this patch just exposes it for direct use by our code.

[`bytes`]: https://crates.io/crates/bytes
[review on #4646]: #4646 (comment)

Test Plan:
It builds: `bazel build //tensorboard/data/server/cargo:bytes`.

wchargin-branch: rust-dep-bytes
wchargin-source: 13445ec2b94489c55c33e0c3eea775d9e06aa683
@wchargin wchargin added dependencies Pull requests that update a dependency file core:rustboard //tensorboard/data/server/... labels Feb 9, 2021
@google-cla google-cla bot added the cla: yes label Feb 9, 2021
@wchargin wchargin requested a review from psybuzz February 10, 2021 02:43
@wchargin wchargin merged commit 842296a into master Feb 10, 2021
@wchargin wchargin deleted the wchargin-rust-dep-bytes branch February 10, 2021 19:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla: yes core:rustboard //tensorboard/data/server/... dependencies Pull requests that update a dependency file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants