4 ms·
Any performance numbers?
by anonacct37 9y ago
Any performance numbers?
- spenczar5 9y agoIt's really hard to write benchmarks of an RPC system that mean much, but the overhead is really just in serialization. We have services that handle tens of thousands of requests per second on Twirp in one process. Serialization/deserialization of a typical protobuf struct takes a microsecond or two, but it generates some garbage, so GC ends up slowing you down if you try to go really crazy and push past 100k req/s in one process with non-trivial message structures.
- anonacct37 9y agoThanks, that's the exact info I was looking for. I've unfortunately been bitten before by choosing json as a serialization format, specifically in go, due to JSON performance dominating processing. No criticism though, JSON is the right choice for many types of APIs.
- spenczar5 9y agoYou can and should use Twirp's protobuf serialization instead for almost all applications. The JSON serialization is really intended for developers and low-throughput cross-language clients. Protobuf serialization isn't free, but it's definitely cheaper than JSON serialization.