Gogoprotobuf is extremely fast!

Was playing around with gogoprotobuf and here are the benchmark comparisons.

On develop branch with goprotobuf:

BenchmarkToPBMarshal_10_Actor-2           500000              2704 ns/op             712 B/op          7 allocs/op
BenchmarkToPBMarshal_10_Director-2        500000              3874 ns/op            1224 B/op          8 allocs/op
BenchmarkToPBMarshal_100_Actor-2           50000             24739 ns/op            6856 B/op         11 allocs/op
BenchmarkToPBMarshal_100_Director-2        50000             37483 ns/op           14792 B/op         13 allocs/op
BenchmarkToPBMarshal_1000_Actor-2          10000            173239 ns/op           70856 B/op         18 allocs/op
BenchmarkToPBMarshal_1000_Director-2        3000            519368 ns/op          211530 B/op         23 allocs/op
BenchmarkToPBUnmarshal_10_Actor-2         300000              4181 ns/op             976 B/op         24 allocs/op
BenchmarkToPBUnmarshal_10_Director-2      200000              6286 ns/op            1416 B/op         36 allocs/op
BenchmarkToPBUnmarshal_100_Actor-2         30000             41495 ns/op           10336 B/op        238 allocs/op
BenchmarkToPBUnmarshal_100_Director-2      20000             65949 ns/op           14352 B/op        387 allocs/op
BenchmarkToPBUnmarshal_1000_Actor-2         5000            276224 ns/op           71504 B/op       1591 allocs/op
BenchmarkToPBUnmarshal_1000_Director-2      2000            951278 ns/op          200146 B/op       5523 allocs/op

On the branch with gogoprotobuf change:

BenchmarkToPBMarshal_10_Actor-2          2000000               704 ns/op             224 B/op          1 allocs/op
BenchmarkToPBMarshal_10_Director-2       1000000              1145 ns/op             352 B/op          1 allocs/op
BenchmarkToPBMarshal_100_Actor-2          200000              7221 ns/op            2560 B/op          1 allocs/op
BenchmarkToPBMarshal_100_Director-2       100000             13138 ns/op            4096 B/op          1 allocs/op
BenchmarkToPBMarshal_1000_Actor-2          30000             47879 ns/op           16640 B/op          1 allocs/op
BenchmarkToPBMarshal_1000_Director-2       10000            184126 ns/op           57344 B/op          1 allocs/op
BenchmarkToPBUnmarshal_10_Actor-2         500000              2553 ns/op             768 B/op         23 allocs/op
BenchmarkToPBUnmarshal_10_Director-2      300000              3929 ns/op            1208 B/op         35 allocs/op
BenchmarkToPBUnmarshal_100_Actor-2         50000             26547 ns/op           10128 B/op        237 allocs/op
BenchmarkToPBUnmarshal_100_Director-2      30000             44530 ns/op           14144 B/op        386 allocs/op
BenchmarkToPBUnmarshal_1000_Actor-2        10000            180549 ns/op           71296 B/op       1590 allocs/op
BenchmarkToPBUnmarshal_1000_Director-2      2000            643745 ns/op          202258 B/op       5522 allocs/op

There is almost a three to four fold speedup in case of Marshalling and some improvement in Unmarshalling!

3 Likes

Nice! also check unmarshal.

This is for client comm right?

Yeah, this is for the client communication. Will add benchmark for Unmarshal.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.