risingwave icon indicating copy to clipboard operation
risingwave copied to clipboard

Replace serde-protobuf and rust-protobuf with prost?

Open ice1000 opened this issue 1 year ago • 3 comments

We're using 3 different protobuf crates at the very same time (🤯). Maybe we want to only use prost, as it's supported by:

  • https://github.com/tikv/grpc-rs
  • https://github.com/hyperium/tonic, the successor of tower-grpc

Plus, the code generated by prost is more friendly to move semantics.

P.S. PingCAP tried to migrate from rust-protobuf to prost in 2019, but the runtime performance didn't change much (*). However, there are still good reasons to migrate:

  1. Less dependencies (faster build time)
  2. Rust-protobuf generates bloated code that slows down compilation and takes lots of time to optimize (even faster build time)

*: I blame the migration strategy -- we wrapped the prost generated code with a rust-protobuf-like layer, and that's probably slowing down everything.

ice1000 avatar Aug 04 '22 20:08 ice1000

I believe the dependency can be removed as long as we go through the protobuf decoding thing in connectors. cc @tabVersion may take a look if you have time :)

skyzh avatar Aug 05 '22 20:08 skyzh

Do we really use rust-protobuf in gRPC? I think it should have been replaced with prost long ago. 🥵

BugenZhao avatar Aug 09 '22 05:08 BugenZhao

Do we really use rust-protobuf in gRPC? I think it should have been replaced with prost long ago. 🥵

No. The dependency is only introduced in tikv's rust-prometheus (as an optional feature, which we enabled) and risingwave-source. I think we can supersede the usage in risingwave-source.

ice1000 avatar Aug 09 '22 06:08 ice1000

This issue has been open for 60 days with no activity. Could you please update the status? Feel free to continue discussion or close as not planned.

github-actions[bot] avatar Oct 09 '22 02:10 github-actions[bot]

Probably impossible

ice1000 avatar Oct 09 '22 03:10 ice1000

There's https://docs.rs/prost-reflect/latest/prost_reflect/index.html, probably someone is working on this.

skyzh avatar Oct 09 '22 03:10 skyzh

There's https://docs.rs/prost-reflect/latest/prost_reflect/index.html, probably someone is working on this.

I am looking into this and I will take the issue

tabVersion avatar Oct 09 '22 03:10 tabVersion

So "probably impossible" is probably impossible then

ice1000 avatar Oct 09 '22 04:10 ice1000