-
Notifications
You must be signed in to change notification settings - Fork 726
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
[subsystem] improve parallelization by consuming messages inbetween overseer signals in parallel #933
Comments
There are certain instances where we actually want specific messages to block execution flow. A prime example is handling overseer signals. For instance, paritytech/polkadot#3924 only works because we ensure that the dispute coordinator handles collecting backing votes and candidates before we handle a message from a corresponding approval task that issues an |
As a design choice, I would advocate for non-parallel as a default and we should be explicit about which work we do in the background. There are likely diminishing returns for processing more and more messages in parallel, and it may even reduce performance at some point due to increased reliance on shared state. |
The idea is not so much about the fact that compute power is limited or speeding things up, but rather being bottlenecked on a single subsystem that does some (relatively speaking) heavier computations and hence become a bottleneck when doing serial processing as we currently do. The above approach is particularly interesting for those. I fully agree to stating things explicitly. If we can guarantee on synchronization on For a few individual subsystems this could play out very well, for others, less so. Candidates to consider are those subsystems that are:
|
Re-prioritizing in face of paritytech/polkadot#4911 |
* do not spawn additional task for on-demand relays * compilation
The futures API we could consider to use more in order to avoid the stalling subsystems:
https://docs.rs/futures/0.3.17/futures/prelude/stream/trait.StreamExt.html#method.buffer_unordered
Currently we use a bunch of
for msg in source.await() { match msg {} }
style patterns which is rather prohibitive of any parallelization.There are a few perils of
Signal
s vs regularMessages
(again) that need to be taken into account. The sequencing within the overseer is not sufficient. This might require some additional logic aroundBufferUnordered
or a custom impl that isSignal
/Message
-semantic aware.This will have two effects:
The text was updated successfully, but these errors were encountered: