gorpc icon indicating copy to clipboard operation
gorpc copied to clipboard

add benchmark results to docs

Open gucki opened this issue 10 years ago • 2 comments

You state your library is high performace, but It'd be great if the docs would contain some performance numbers/ benchmarks compared to net/rpc. Especially for different workloads (small requests, large requests with byte slices, ...).

gucki avatar Aug 15 '15 10:08 gucki

I'll definitely add real-life benchmark results comparing gorpc to net/rpc (and, probably, other popular rpc implementations) into README.md.

Currently bench_test.go contains benchmarks, which can be used for performance comparisons with certain grain of salt. Here are results from my machine:

    $ go test -run=None -bench=rpc
    PASS
    BenchmarkNetrpcInt-4           50000         29676 ns/op
    BenchmarkNetrpcByteSlice-4     50000         30501 ns/op
    BenchmarkNetrpcStruct-4        20000         75986 ns/op
    BenchmarkGorpcInt-4           100000         20267 ns/op
    BenchmarkGorpcByteSlice-4      50000         21694 ns/op
    BenchmarkGorpcStruct-4         20000         62887 ns/op

These results may be far from real life, since both server and client are running on the same machine during benchmarks. In the real world client and server are usually located on distinct physical machines connected over the network. Gorpc should work faster in the real world, since it:

  • minimizes the number of send()/recv() syscalls under high load (which, in turn, should minimize the number of network packets required for rpc).
  • minimizes the amount of data floating over the network between client and server.

valyala avatar Aug 16 '15 20:08 valyala

Maybe, we can put on benchmark to compare with gRPC

renanbastos93 avatar May 13 '21 13:05 renanbastos93