A drop-in, lightweight gRPC replacement.
- Simple, at just a few thousand lines of code.
- Low external dependencies. Only 3 requirements in go.mod, and 9 lines of
go mod graph
! - 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.
DRPC is licensed under the MIT/expat license. See the LICENSE file for more.
These microbenchmarks attempt to provide a comparison and come with some caveats. First, it does not send data over a network connection which is expected to be the bottleneck almost all of the time. Second, no attempt was made to do the benchmarks in a controlled environment (CPU scaling disabled, noiseless, etc.). Third, no tuning was done to ensure they're both performing optimally, so there is an inherent advantage for DRPC because the author is familiar with how it works.
Measure | Benchmark | Small | Medium | Large | |||||||||
gRPC | DRPC | delta | gRPC | DRPC | delta | gRPC | DRPC | delta | |||||
time/op | Unitary | 30.2µs | 8.6µs | -71.60% | 38.0µs | 11.1µs | -70.88% | 1.33ms | 0.63ms | -52.30% | |||
Input Stream | 878ns | 759ns | -13.54% | 2.85µs | 2.00µs | -29.69% | 508µs | 249µs | -51.08% | ||||
Output Stream | 862ns | 757ns | -12.18% | 2.76µs | 1.99µs | -27.92% | 487µs | 239µs | -50.94% | ||||
Bidir Stream | 9.81µs | 3.30µs | -66.38% | 14.8µs | 4.9µs | -66.69% | 1.31ms | 0.55ms | -58.41% | ||||
speed | Unitary | 70.0kB/s | 230.0kB/s | +228.57% | 54.0MB/s | 185.3MB/s | +243.44% | 791MB/s | 1658MB/s | +109.62% | |||
Input Stream | 2.29MB/s | 2.64MB/s | +15.37% | 721MB/s | 1026MB/s | +42.21% | 2.06GB/s | 4.22GB/s | +104.32% | ||||
Output Stream | 2.32MB/s | 2.64MB/s | +13.67% | 743MB/s | 1031MB/s | +38.74% | 2.15GB/s | 4.39GB/s | +103.75% | ||||
Bidir Stream | 200kB/s | 604kB/s | +201.87% | 138MB/s | 415MB/s | +200.20% | 799MB/s | 1920MB/s | +140.44% | ||||
mem/op | Unitary | 8.37kB | 1.29kB | -84.59% | 21.8kB | 7.7kB | -64.81% | 6.50MB | 3.16MB | -51.38% | |||
Input Stream | 399B | 80B | -79.96% | 7.09kB | 2.13kB | -69.97% | 3.20MB | 1.05MB | -67.16% | ||||
Output Stream | 309B | 80B | -74.13% | 6.98kB | 2.13kB | -69.53% | 3.20MB | 1.05MB | -67.17% | ||||
Bidir Stream | 1.02kB | 0.24kB | -76.40% | 14.4kB | 4.3kB | -69.99% | 6.52MB | 2.10MB | -67.74% | ||||
allocs/op | Unitary | 169 | 7 | -95.86% | 171 | 9 | -94.74% | 403 | 9 | -97.76% | |||
Input Stream | 11 | 1 | -90.91% | 12 | 2 | -83.33% | 121 | 2 | -98.35% | ||||
Output Stream | 9 | 1 | -88.89% | 10 | 2 | -80.00% | 117 | 2 | -98.29% | ||||
Bidir Stream | 41 | 3 | -92.68% | 44 | 5 | -88.64% | 272 | 5 | -98.16% |
Package | Lines |
---|---|
storj.io/drpc/cmd/protoc-gen-go-drpc | 418 |
storj.io/drpc/drpcstream | 388 |
storj.io/drpc/drpcwire | 326 |
storj.io/drpc/drpcmanager | 280 |
storj.io/drpc/drpcmigrate | 237 |
storj.io/drpc/drpchttp | 214 |
storj.io/drpc/drpcsignal | 133 |
storj.io/drpc/drpcconn | 116 |
storj.io/drpc/drpcmetadata | 115 |
storj.io/drpc/drpcmux | 95 |
storj.io/drpc/drpcserver | 76 |
storj.io/drpc/drpccache | 54 |
storj.io/drpc | 48 |
storj.io/drpc/drpcerr | 42 |
storj.io/drpc/drpcctx | 37 |
storj.io/drpc/drpcdebug | 19 |
storj.io/drpc/drpcenc | 15 |
storj.io/drpc/internal/drpcopts | 11 |
Total | 2624 |