-
Notifications
You must be signed in to change notification settings - Fork 253
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
Zero copy for send #238
Zero copy for send #238
Conversation
@overvenus PTAL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Writing down some notes
Tests fixed, please review @overvenus @BusyJay |
Oh my god. I'll fix them |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Writing down some notes.
Also: rustfmt is complaining about the order of use
s, should fix
Signed-off-by: ice1000 <ice1000kotlin@foxmail.com>
Signed-off-by: ice1000 <ice1000kotlin@foxmail.com>
Signed-off-by: ice1000 <ice1000kotlin@foxmail.com>
Signed-off-by: ice1000 <ice1000kotlin@foxmail.com>
Signed-off-by: ice1000 <ice1000kotlin@foxmail.com>
Signed-off-by: ice1000 <ice1000kotlin@foxmail.com>
Signed-off-by: ice1000 <ice1000kotlin@foxmail.com>
Signed-off-by: ice1000 <ice1000kotlin@foxmail.com>
Signed-off-by: ice1000 <ice1000kotlin@foxmail.com>
Signed-off-by: ice1000 <ice1000kotlin@foxmail.com>
Signed-off-by: ice1000 <ice1000kotlin@foxmail.com>
Signed-off-by: ice1000 <ice1000kotlin@foxmail.com>
…e not merging my PR) Signed-off-by: ice1000 <ice1000kotlin@foxmail.com>
Signed-off-by: ice1000 <ice1000kotlin@foxmail.com>
Signed-off-by: ice1000 <ice1000kotlin@foxmail.com>
Signed-off-by: ice1000 <ice1000kotlin@foxmail.com>
Edit: added some more TODOs |
# Conflicts: # benchmark/src/bench.rs # grpc-sys/src/lib.rs # src/call/client.rs # src/call/mod.rs # src/call/server.rs # src/codec.rs # src/lib.rs
Signed-off-by: ice1000 <ice1000kotlin@foxmail.com>
Signed-off-by: ice1000 <ice1000kotlin@foxmail.com>
Signed-off-by: ice1000 <ice1000kotlin@foxmail.com>
Signed-off-by: ice1000 <ice1000kotlin@foxmail.com>
# Conflicts: # benchmark/src/bench.rs # src/call/client.rs # src/call/mod.rs # src/call/server.rs # src/codec.rs # src/lib.rs
Signed-off-by: ice1000 <ice1000kotlin@foxmail.com>
Signed-off-by: ice1000 <ice1000kotlin@foxmail.com>
Signed-off-by: ice1000 <ice1000kotlin@foxmail.com>
Thanks @ice1000 Have you already integrated it into TiKV and run the tests, benchmarks? |
Not yet in TiKV. Are you hurry? I have an essay due 5 days later while I've just get started (and I'm really really sorry about that 🙏) :( |
Travis CI GGed with this warning:
|
Signed-off-by: ice1000 <ice1000kotlin@foxmail.com>
Original work by @ice1000 Signed-off-by: Nick Cameron <nrc@ncameron.org>
Original work by @ice1000 Signed-off-by: Nick Cameron <nrc@ncameron.org>
Supersceded by #382 ? |
Yes |
\o/ |
TODOs
size_t
6 in Rust becomessize_t
in C 140184721559552 via FFI (140184721559552+6 is 2^47)GrpcSlice
GrpcByteBuffer
Now (updated at: 23, April 2019)
Since @nrc has introduced prost support (instead of rust-protobuf) which is natively using "bytes", we no longer have that one copy for send which is stated to be necessary below.
Yay!
Before:
&[u8]
, we copied the data into aVec<u8>
, this is done internally in the protobuf library (copy 0)grpc_slice
(a ref-counted single string) by copying theVec<u8>
mentioned above (copy 1)grpc_byte_buffer
(a ref-counted list of strings) from only onegrpc_slice
Total copy: 2
After:
&[u8]
, we copied each produced&[u8]
and collect them into agrpc_byte_buffer
(copy 0)Total copy: 1
The reason why still one copy: