A drop-in, lightweight gRPC replacement.
- 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.
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 | |||||||||
gRPC | DRPC | delta | gRPC | DRPC | delta | gRPC | DRPC | delta | |||||
Unitary | time/op | 39.5µs | 17.1µs | -56.64% | 39.7µs | 21.5µs | -45.83% | 1.35ms | 0.65ms | -52.07% | |||
speed | 53.8kB/s | 120.0kB/s | +123.26% | 51.7MB/s | 95.4MB/s | +84.48% | 775MB/s | 1618MB/s | +108.64% | ||||
mem/op | 8.43kB | 2.05kB | -75.65% | 21.9kB | 8.5kB | -61.43% | 6.51MB | 3.22MB | -50.44% | ||||
allocs/op | 169 | 20 | -88.17% | 171 | 22 | -87.13% | 422 | 23 | -94.64% | ||||
Input Stream | time/op | 856ns | 2501ns | +192.29% | 2.95µs | 3.37µs | +14.09% | 544µs | 263µs | -51.73% | |||
speed | 2.28MB/s | 0.80MB/s | -64.91% | 696MB/s | 610MB/s | -12.35% | 1.93GB/s | 3.99GB/s | +107.18% | ||||
mem/op | 409B | 80B | -80.46% | 7.09kB | 2.13kB | -69.99% | 3.22MB | 1.08MB | -66.39% | ||||
allocs/op | 11 | 1 | -90.91% | 12 | 2 | -83.33% | 128 | 2 | -98.44% | ||||
Output Stream | time/op | 953ns | 2585µs | +171.35% | 2.87µs | 3.49µs | +21.56% | 532µs | 247µs | -53.50% | |||
speed | 4.20MB/s | 1.55MB/s | -63.15% | 716MB/s | 589MB/s | -17.74% | 1.97GB/s | 4.24GB/s | +115.02% | ||||
mem/op | 371B | 160B | -56.89% | 7.06kB | 2.21kB | -68.75% | 3.21MB | 1.06MB | -66.98% | ||||
allocs/op | 11 | 2 | -80.00% | 11 | 3 | -72.73% | 131 | 3 | -97.70% | ||||
Bidir Stream | time/op | 10.7µs | 5.3µs | -50.67 | 15.9µs | 7.2µs | -54.36% | 1.38ms | 0.61ms | -55.79% | |||
speed | 185kB/s | 379kB/s | +104.63% | 129MB/s | 284MB/s | +119.11% | 761MB/s | 1659MB/s | +117.91% | ||||
mem/op | 1.02kB | 0.24kB | -76.44% | 14.5kB | 4.3kB | -69.99% | 6.52MB | 2.17MB | -66.66% | ||||
allocs/op | 41 | 3 | -92.68% | 44 | 5 | -88.64% | 291 | 6 | -98.07% |
DRPC is licensed under the MIT/expat license. See the LICENSE file for more.