Some background

If you’re a developer looking to build a reliable, memory safe, high performance application today, Rust & Go are surely your options.

If you’re looking to get even more performance out of your internal applications, you might also want to look at using gRPC instead of a normal REST api. All these are solutions to reducing your computational overhead.

I try to compare various libraries to understand their performance and hope you find it helpful.

Libraries looked at

  • tower-grpc (Rust)
  • A performant rust library, though it is replaced with tonic
  • grpc-go (Golang)
  • The official go module for grpc.
  • grpc-rust (Rust)
  • Still in development, another grpc in rust. Looked promising.
  • tonic (Rust)
  • An improved update from tower-grpc supporting the new await syntax
  • grpc-node (NodeJs)
  • Included for a benchmarking reference point.
  • grpc-rs (Rust — C bindings)
  • A rust library that uses grpc

Benchmark Tool

For the benchmark I’ll use the equivalent of Hey for gRPC, ghz.

The test will focus on how much overhead there is if the same load of 10,000 concurrent requests is sent to servers using each of the libraries above. I will use the same helloworld greeter for each. TLS will not be enabled for any of the tests so we can get an idea of the raw performance with each.

#rust #go #grpc #developer

Benchmarking gRPC in Rust & Go
32.65 GEEK