prost
shared-string
Our great sponsors
prost | shared-string | |
---|---|---|
14 | 1 | |
3,513 | 2 | |
4.6% | - | |
8.3 | 0.0 | |
4 days ago | almost 3 years ago | |
Rust | Rust | |
Apache License 2.0 | Apache License 2.0 |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
prost
-
Fivefold Slower Compared to Go? Optimizing Rust's Protobuf Decoding Performance
The benchmark is not comparing apples to apples.
prost is the most widely used Protobuf implementation in Rust, maintained by the Tokio organization. prost generates structs and serialization/deserialization code for you.
easyproto according to GitHib Search is used only by two projects. easyproto provides primitives for serializing and deserializing Protobuf, and requires hand writing code to do both.
A fair comparison would be prost vs google.golang.org/protobuf, or easyproto vs parts of quick-protobuf.
In most cases you can make Go as fast as Rust, but from my experience writing performance-sensitive code in Go requires significantly larger time investment and overall requires deeper language expertise. Pebble (RocksDB replacement in Go by CockroachDB) is a good example of this, the codebase is littered with hand-inlined[1] functions, hand-unrolled loops and it's not[2] even using Go memory management for performance critical parts, it's using the C memory allocator and manual memory management.
[prost]: https://github.com/tokio-rs/prost
- How Turborepo is porting from Go to Rust
-
Hey Rustaceans! Got a question? Ask here! (49/2022)!
You could use Protocol buffers to define a message type, then use prost to generate encoding/decoding code for that type.
- Adding #derive to a struct defined in another place
-
grpc gateway
Thanks but that doesn't seems to support `json_mapping` , there is a draft available but not sure when it will get merged https://github.com/tokio-rs/prost/pull/558
-
[help] Tonic-build: how to generate generic service definition?
Hi r/rust, I have a question regarding tonic-build (or prost-build).
-
Unwrapping inner values from the enum more easily?
Currently, I'm making some stuff by using protobuf via prost. Maybe you know, protobuf v3 treats all fields as optional, so it is pain to unwrap every nested field.
- Best way to communicate between Rust and Go?
-
Past, present and future of rust-protobuf
Note: one additional key feature currently missing from Prost is Proto2 extensions.
- Does prost [protocol buffers for rust] use tokio runtime to implement GRPC service?
shared-string
-
Saving Some Allocations
A few weeks back i made a crate (shared-string) that more or less does what your describing in your post. But the underlying data structure is, preferably Rc or Arc if you need to use it between threads. I though about using Bytes but if you look at the imlementation it does a lot in the background. But never the less i changed Rc and Arc to Bytes to look how it would performance. When i saw the benchmarks i was discouraged, they weren't great. In my benchmark it was always slower than just using a String. Maybe somewhere i made a mistake or the benchmarks are not the right ones. Here the bytes implementation with some benchmark results: https://github.com/soerenmeier/shared-string/pull/1
What are some alternatives?
rust-protobuf - Rust implementation of Google protocol buffers
prost - PROST! a Protocol Buffers implementation for the Rust Language
tonic - A native gRPC client & server implementation with async/await support.
cargo-raze - Generate Bazel BUILD from Cargo dependencies!
varint-simd - Decoding and encoding gigabytes of LEB128 variable-length integers per second in Rust with SIMD
ts-proto - An idiomatic protobuf generator for TypeScript
prost - PROST! a Protocol Buffers implementation for the Rust Language
bytes - Utilities for working with bytes
console - a debugger for async rust!
rust-multiplayer-physics - A multiplayer physics playground, written in rust.
linkerd2-proxy-api - A service mesh for Kubernetes and beyond. gRPC API bindings repo for Linkerd 2.x.
bitbox02-firmware - Firmware code of the BitBox02 hardware wallet