Chinese Yellow Pages | Classifieds | Knowledge | Tax | IME

GRPC

 

client side msg: header, msg, EOS

server side msg:  header, msg, msg,  Trailer

over http2

keep live?

c++ async or sync? https://grpc.io/docs/languages/cpp/async/ , does it provider more performance than sync one?

https://github.com/grpc/grpc/blob/v1.41.0/examples/cpp/helloworld/greeter_async_server.cc

https://stackoverflow.com/questions/68767309/difference-between-sync-and-async-grpc

https://docs.microsoft.com/en-us/dotnet/standard/async-in-depth

https://www.hellsoft.se/understanding-cpu-and-i-o-bound-for-asynchronous-operations/

CPU Bound means the rate at which process progresses is limited by the speed of the CPU. A task that performs calculations on a small set of numbers, for example multiplying small matrices, is likely to be CPU bound.

I/O Bound means the rate at which a process progresses is limited by the speed of the I/O subsystem. A task that processes data from disk, for example, counting the number of lines in a file is likely to be I/O bound.

Memory bound means the rate at which a process progresses is limited by the amount memory available and the speed of that memory access. A task that processes large amounts of in memory data, for example multiplying large matrices, is likely to be Memory Bound.

Cache bound means the rate at which a process progress is limited by the amount and speed of the cache available. A task that simply processes more data than fits in the cache will be cache bound.

I/O Bound would be slower than Memory Bound would be slower than Cache Bound would be slower than CPU Bound.

The solution to being I/O bound isn’t necessarily to get more Memory. In some situations, the access algorithm could be designed around the I/O, Memory or Cache limitations. See Cache Oblivious Algorithms.

https://stackoverflow.com/questions/868568/what-do-the-terms-cpu-bound-and-i-o-bound-mean

 

 

protobuf ( how to pass binary ?)

https://docs.microsoft.com/en-us/aspnet/core/grpc/performance

how to send binary data in protobuf

https://stackoverflow.com/questions/36619520/what-is-the-correct-way-to-send-binary-data-using-protocol-buffers

Json <–> Proto buff

https://developers.google.com/protocol-buffers/docs/reference/cpp
https://stackoverflow.com/questions/34906305/protocol-buffer3-and-json

 

// json does not support binary data, need to encode binary to text ( base64 etc)

message MyRequest {
    string userId = 1;
    map<string, string> params = 2;
} https://developers.google.com/protocol-buffers/docs/proto3

 

 

 

https://www.youtube.com/watch?v=7qL38ea9Ji4&ab_channel=CNCF%5BCloudNativeComputingFoundation%5D