-
Notifications
You must be signed in to change notification settings - Fork 82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
govpp: add rpc-service test to example perf-bench #253
base: master
Are you sure you want to change the base?
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This won't even compile. The ControlPing
returns two values.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please Ignore it....
@@ -122,6 +125,46 @@ func main() { | |||
time.Sleep(time.Second) | |||
} | |||
|
|||
func rpcTest(conn api.Connection, cnt int) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.