-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Forward cross chain messages for different recipients actually in parallel #5005
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
Forward cross chain messages for different recipients actually in parallel #5005
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
91ba951 to
a51cedc
Compare
76aac22 to
a497d6d
Compare
deuszx
left a comment
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.
In the title you say it's for different recipients but I fail to see where it's guaranteed in this code. Can you point it to me?
|
Wether we initially spawn a task or not is controlled by |
a51cedc to
c3b8630
Compare
a497d6d to
16c588a
Compare
|
Interesting. What is the CPU-heavy operation taking advantage of multiple cores? |
|
Like I mentioned in the description, this wasn't really a bottleneck. Was just a place that I thought could be one. But the improvements were small, so we're probably not even exhausting the 1 core with this, as it just gets slightly faster in parallel. |
16c588a to
c209bce
Compare
c3b8630 to
553f6b4
Compare
553f6b4 to
60d57ef
Compare
c209bce to
b5d9bcd
Compare
ma2bd
left a comment
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 found the answer to my question: it's not about CPU. It's about the select! branches preventing other tasks from being polled.

Motivation
Right now we're using
FuturesUnordered, which will poll the futures concurrently in the same task.Proposal
Use
JoinSetso we actually can poll these in parallel, using different coresTest Plan
Benchmarked a network without this, and with this, and with this our cross chain message queue wait time improved by about 10%. This was on a network with 4 worker threads per shard.
Release Plan