maxtruxa / drpc

drpc is a lightweight, drop-in replacement for gRPC

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

DRPC

A drop-in, lightweight gRPC replacement.

Go Report Card Go Doc Beta

Links

Highlights

  • Simple, at just a few thousands lines of code!
  • Compatible. Works for many gRPC use-cases as-is!
  • Fast. DRPC has a lightning quick wire format
  • Extensible. DRPC is transport agnostic, supports middleware, and is designed around interfaces.
  • Battle Tested. Already used in production for years across tens of thousands of servers.

Benchmarks

These microbenchmarks attempt to provide a comparison and come with some caveats. First, gRPC and DRPC have different flushing semantics when sending messages. Specifically, gRPC will buffer for some period whereas DRPC always immediately flushes. This difference is most apparent in the Input/Output Stream benchmarks under the Small and Medium sizes. Second, all microbenchmarks are flawed. These, in particular, do not even send data over a network connection. Third, no attempt was made to do the benchmarks in a controlled environment (CPU scaling disabled, noiseless, etc.).

Benchmark Measure Small Medium Large
gRPCDRPCdelta gRPCDRPCdelta gRPCDRPCdelta
Unitary time/op 39.5µs17.1µs-56.64% 39.7µs21.5µs-45.83% 1.35ms0.65ms-52.07%
speed 53.8kB/s120.0kB/s+123.26% 51.7MB/s95.4MB/s+84.48% 775MB/s1618MB/s+108.64%
mem/op 8.43kB2.05kB-75.65% 21.9kB8.5kB-61.43% 6.51MB3.22MB-50.44%
allocs/op 16920-88.17% 17122-87.13% 42223-94.64%
Input Stream time/op 856ns2501ns+192.29% 2.95µs3.37µs+14.09% 544µs263µs-51.73%
speed 2.28MB/s0.80MB/s-64.91% 696MB/s610MB/s-12.35% 1.93GB/s3.99GB/s+107.18%
mem/op 409B80B-80.46% 7.09kB2.13kB-69.99% 3.22MB1.08MB-66.39%
allocs/op 111-90.91% 122-83.33% 1282-98.44%
Output Stream time/op 953ns2585µs+171.35% 2.87µs3.49µs+21.56% 532µs247µs-53.50%
speed 4.20MB/s1.55MB/s-63.15% 716MB/s589MB/s-17.74% 1.97GB/s4.24GB/s+115.02%
mem/op 371B160B-56.89% 7.06kB2.21kB-68.75% 3.21MB1.06MB-66.98%
allocs/op 112-80.00% 113-72.73% 1313-97.70%
Bidir Stream time/op 10.7µs5.3µs-50.67 15.9µs7.2µs-54.36% 1.38ms0.61ms-55.79%
speed 185kB/s379kB/s+104.63% 129MB/s284MB/s+119.11% 761MB/s1659MB/s+117.91%
mem/op 1.02kB0.24kB-76.44% 14.5kB4.3kB-69.99% 6.52MB2.17MB-66.66%
allocs/op 413-92.68% 445-88.64% 2916-98.07%

Licensing

DRPC is licensed under the MIT/expat license. See the LICENSE file for more.

About

drpc is a lightweight, drop-in replacement for gRPC

License:MIT License


Languages

Language:Go 98.6%Language:Makefile 0.8%Language:Shell 0.6%