Optimizing loopback p2p_send performance. #246
songweijia
started this conversation in
Ideas
Replies: 1 comment
-
And avoid allocating the unused memory. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
In one of Thiago's (@tgarr) experiments with Cascade, he found that the p2p_send is slower for sending to the local node than sending to a remote node. It turns out the reasons lie in the P2PConnection implementation. It copies the data from the outgoing queue buffer to the incoming queue buffer in case of a local loopback p2p_send. This copy can be avoided by writing data directly to the incoming queue buffer for the local case. We only copy the guard to notify the p2p receiving thread of incoming data. Thiago implemented this change in his branch. This is a neat solution with great improvement in his experiment. Now the local p2p_send is much faster than it was before.
I'm considering merging the change to master after a regression test.
Beta Was this translation helpful? Give feedback.
All reactions