Open Shimuuar opened 4 years ago
Another possibility of performance optimization is caching serialized messages before they're sent. This way we save on serializing same message repeatedly
Also as @romcheck suggested that we should add metrics for the time needed to send/receive message over network
It turns out that current implementation of gossip is suboptimal. What have been observed:
In dioxane benchmarks incresing block size makes throughtput of network worse. This hints that gossip could be superlinear in block size and/or delays from sending large block makes delays introduced by sending large block slows things down
Gossip takes a lot of space in profile:
What could be done
There're many ways in which we can attack problem.
Monomorphize monad which is used by gossip. It doesn't call any user-provided callbacks so we pay performance price of polymorphic bind but don't use it!
2.Try to optimize gossip state machine. It's not clear that there are a lot of opportunity there but every bit helps
Maybe we need to rework network abstraction/state machine. Currently TCP assumtionsa re baked quite deeply into
NetworkAPI
Maybe gossiping block in small chunks (#21) will improve performance as well