tree: e17392d06897ae3f8ba784872913339b8f6cab78
  1. api/
  2. protocol/
  3. test/
  4. go.mod
  5. go.sum
  6. main.go
  7. Makefile
  8. README.md
  9. README_CN.md
tools/benchmark/README.md

Benchmark Results

Test environment: macOS, Apple Silicon, N=500 samples per method

gRPC Protocol

gRPC Direct

MethodMinMedianMeanStdDevMax
GetUser100µs200µs400µs1.1ms8.2ms
GetUsers100µs200µs200µs100µs400µs
GetUserByName100µs200µs200µs100µs600µs
SayHello100µs200µs200µs100µs400µs

gRPC via Pixiu

MethodMinMedianMeanStdDevMax
GetUser600µs1.4ms1.8ms1.8ms12.7ms
GetUsers500µs1.4ms1.7ms1.2ms14.6ms
GetUserByName500µs1.3ms2ms2ms17.1ms
SayHello600µs1.3ms1.8ms2ms32.8ms

Triple Protocol

Triple Direct

MethodMinMedianMeanStdDevMax
GetUser200µs1.8ms2.5ms2.4ms14.5ms
GetUsers200µs1.5ms2.0ms2.0ms12.0ms
GetUserByName200µs1.2ms1.8ms1.8ms10.5ms
SayHello200µs900µs1.4ms1.3ms12.5ms

Triple via Pixiu

MethodMinMedianMeanStdDevMax
GetUser1ms2.1ms2.8ms3.1ms24.4ms
GetUsers800µs2.0ms2.5ms2.5ms20.0ms
GetUserByName700µs1.8ms2.3ms2.0ms18.0ms
SayHello700µs2ms2.5ms1.4ms12ms

Dubbo Protocol

Dubbo Direct

MethodMinMedianMeanStdDevMax
GetUser100µs200µs600µs2.8ms20.7ms
GetGender0s100µs200µs100µs600µs
GetUser0100µs100µs200µs0s400µs
GetUsers100µs200µs200µs100µs600µs
GetUser20s200µs200µs100µs500µs
GetErr300µs500µs500µs200µs1.4ms

Dubbo via Pixiu

MethodMinMedianMeanStdDevMax
GetUser700µs2ms3ms5.9ms44.7ms
GetGender300µs800µs1ms500µs3.1ms
GetUser0300µs700µs800µs500µs4.2ms
GetUsers100µs500µs600µs400µs3.2ms

Performance Summary

Pixiu proxy adds approximately 0.3-1.1ms overhead compared to direct protocol calls.

ProtocolDirect (Median)via Pixiu (Median)Overhead
gRPC~200µs~1.3ms~1.1ms
Triple~1.4ms~2ms~0.6ms
Dubbo~200µs~700µs~0.5ms

How to Run

  1. Build the Pixiu executable

Change the working directory to the root of dubbo-go-pixiu and build the Pixiu executable.

go build -o tools/benchmark/dist/pixiu cmd/pixiu/pixiu.go

The final executable will be located at tools/benchmark/dist/pixiu, which will be used in subsequent tests.

  1. Start the Zookeeper service
docker run -d --name zk -p 2181:2181 zookeeper:latest
  1. Run the test code

Change the working directory to dubbo-go-pixiu/tools/benchmark/test.

# Run All Tests
go test -v ./...

# Run Dubbo Tests
go test -v dubbo_suite/dubbo_test.go

# Run gRPC Tests
go test -v grpc_suite/grpc_test.go

# Run Triple Tests
go test -v triple_suite/proto_suite/proto_test.go