cartesi / machine-emulator

The off-chain implementation of the Cartesi Machine
GNU Lesser General Public License v3.0
58 stars 32 forks source link

Optimize jsonrpc request throughput #222

Closed edubart closed 1 month ago

edubart commented 3 months ago

Context

Currently these are some numbers of very lightweight advance requests (without forks) made through local/jsonrpc/grpc machines:

local 2819.05 req/s
jsonrpc 491.62 req/s
grpc 69.71 req/s

Local is way faster than jsonrpc, jsonrpc adds the overhead of:

Possible solutions

We can optimize jsonrpc requests during a remote machine session by using keep alive connections, if that is not enough, we should also investigate if there are simple ways to optimize the serialization or networking.