Linux 测试环境
BenchmarkParallelHprose2-2 200000 9239 ns/op 789 B/op 25 allocs/op
BenchmarkParallelHprose2Unix-2 200000 6400 ns/op 789 B/op 25 allocs/op
BenchmarkParallelHprose-2 100000 12541 ns/op 4405 B/op 63 allocs/op
BenchmarkParallelHproseUnix-2 200000 9907 ns/op 4405 B/op 63 allocs/op
BenchmarkParallelGobRPC-2 100000 17895 ns/op 360 B/op 12 allocs/op
BenchmarkParallelGobRPCUnix-2 100000 12373 ns/op 360 B/op 12 allocs/op
BenchmarkParallelJSONRPC-2 100000 21693 ns/op 1218 B/op 30 allocs/op
BenchmarkParallelJSONRPCUnix-2 100000 15956 ns/op 1218 B/op 30 allocs/op
非并行测试
BenchmarkHprose2-2 100000 14252 ns/op 789 B/op 25 allocs/op
BenchmarkHprose2Unix-2 200000 9885 ns/op 789 B/op 25 allocs/op
BenchmarkHprose-2 100000 18234 ns/op 4405 B/op 63 allocs/op
BenchmarkHproseUnix-2 100000 13060 ns/op 4405 B/op 63 allocs/op
BenchmarkGobRPC-2 100000 20534 ns/op 360 B/op 12 allocs/op
BenchmarkGobRPCUnix-2 100000 14351 ns/op 360 B/op 12 allocs/op
BenchmarkJSONRPC-2 50000 24350 ns/op 1224 B/op 30 allocs/op
BenchmarkJSONRPCUnix-2 100000 18321 ns/op 1224 B/op 30 allocs/op
Mac 测试环境
- go1.7.1 darwin/amd64
- macOS Sierra
- iMac (Retina 5K, 27-inch, Late 2015)
- 处理器 4GHz Intel Core i7
- 内存 32 GB 1867 MHz DDR3
并行测试
BenchmarkParallelHprose2-8 200000 11080 ns/op 791 B/op 25 allocs/op
BenchmarkParallelHprose2Unix-8 300000 5238 ns/op 791 B/op 25 allocs/op
BenchmarkParallelHprose-8 200000 11243 ns/op 4405 B/op 63 allocs/op
BenchmarkParallelHproseUnix-8 300000 5702 ns/op 4405 B/op 63 allocs/op
BenchmarkParallelGobRPC-8 100000 16815 ns/op 360 B/op 12 allocs/op
BenchmarkParallelGobRPCUnix-8 200000 6707 ns/op 360 B/op 12 allocs/op
BenchmarkParallelJSONRPC-8 100000 17649 ns/op 1216 B/op 30 allocs/op
BenchmarkParallelJSONRPCUnix-8 200000 7809 ns/op 1216 B/op 30 allocs/op
非并行测试
BenchmarkHprose2-8 50000 34164 ns/op 791 B/op 25 allocs/op
BenchmarkHprose2Unix-8 100000 12012 ns/op 791 B/op 25 allocs/op
BenchmarkHprose-8 50000 35938 ns/op 4405 B/op 63 allocs/op
BenchmarkHproseUnix-8 100000 13122 ns/op 4405 B/op 63 allocs/op
BenchmarkGobRPC-8 30000 47610 ns/op 360 B/op 12 allocs/op
BenchmarkGobRPCUnix-8 50000 24507 ns/op 360 B/op 12 allocs/op
BenchmarkJSONRPC-8 30000 51826 ns/op 1224 B/op 30 allocs/op
BenchmarkJSONRPCUnix-8 50000 29195 ns/op 1224 B/op 30 allocs/op
- Hprose2 表示 Hprose 2.0
- Hprose 表示 Hprose 1.x
- GobRPC 表示 go 内置的 net/rpc
- JSONRPC 表示 go 内置的 net/rpc/jsonrpc
- 带 Unix 表示 Unix Socket 通讯,不带 Unix 表示 TCP 通讯
原文:
https://github.com/hprose/hprose-golang/wiki/%E6%80%A7%E8%83%BD%E6%B5%8B%E8%AF%95