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

sluongng/proto use codecv2 #8352

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft

Conversation

sluongng
Copy link
Contributor

  • vtprotocodec: user codecV2 for grpc client/server
  • correct capitalization
  • feat: Use CodecV2 for proto encoding/decoding

Switch to use codecV2 backed by the default buffer pool to handle all
Marshaling/Unmarshaling by grpc clients/servers. The default buffer pool
is already setup here.

```
server/util/grpc_client/grpc_client.go
254:		experimental.WithBufferPool(mem.DefaultBufferPool()),

server/util/grpc_server/grpc_server.go
240:		experimental.BufferPool(mem.DefaultBufferPool()),
```

This does not affect the manual Marshaling/Unmarshaling that we does via
`server/util/proto.{Marshal,Unmarshal}()`. These should still use V1 for
the time being.
Route all proto encode/decode through encoding.CodecV2, which is
implemented in vtprotocodec package. This means that proto encode/decode
will attempt reuse the pre-allocated mem.DefaultBuffer as much as
possible.

Since we are copying these directly to []byte right now, there is not
much benefit to this. We should investigate using mem.Buffer instead of
[]byte so that we can delay the materialization of the blob as late as
possible.
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.

1 participant