govpp: add rpc-service test to example perf-bench#253
govpp: add rpc-service test to example perf-bench#253mohsinkazmi wants to merge 2 commits intoFDio:masterfrom
Conversation
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
| func rpcTestAsync(conn api.Connection, cnt int) { | ||
| fmt.Printf("Running async RPC perf test with %d requests...\n", cnt) | ||
|
|
||
| ctxChan := make(chan memclnt.RPCService, cnt) |
There was a problem hiding this comment.
This is wrong. The memclnt.RPCService is a an interface of RPC service client that is needed to be created only once.
There was a problem hiding this comment.
Ignore rpcTestAsync function. It should have been deleted. you can check this function has never been called.
| go func() { | ||
|
|
||
| for i := 0; i < cnt; i++ { | ||
| ctxChan <- c.ControlPing(context.Background(), &memclnt.ControlPing{}) |
There was a problem hiding this comment.
This won't even compile. The ControlPing returns two values.
There was a problem hiding this comment.
Please Ignore it....
| time.Sleep(time.Second) | ||
| } | ||
|
|
||
| func rpcTest(conn api.Connection, cnt int) { |
There was a problem hiding this comment.
The function syncTest2 is optimized way to use stream. It does basically the same thing ControlPing RPC call does, but reused the same stream which makes it more performant.
There was a problem hiding this comment.
I recommend reading Sending API messages from our GoVPP User Guide and RPC services and Stream API for more in-depth documentation of how it works.
There was a problem hiding this comment.
We are using RPC services in our private application and can't change the whole code base to stream APIs. I have benchmarked them and got different results from stream APIs and RPC services API.
Thanks for the reading list. I have already read them.
The point here is to improve the overall performance of stream APIs and RPC service APIs.
Add support for RPC-service test.