Skip to content

Channel tweaking benchmarks

Marc Konig requested to merge adjust-channel-depth-bench into master

Channels from the validator dispatcher to the LinkValidators are tweaked, making the first 2 spawned validators have a channel depth of 1000 and each subsequent validator is spawned with an unbounded channel depth.

Reason for the first 2 spawned validators to have depths of 1000 and not unbounded:

  • The previous depth of 100 was just quite low so the increase to 1000 reduces overhead
  • In the cases where only 1-2 validators are used, having the channel depth be unbounded can cause cases where on side (the dispatcher) just keeps inserting elements into the channel without ever letting the validator get elements (it effectively blocks until the dispatcher is completely done) so a bounded size better allows the validator do work in parallel

Why is the channel unbounded from validator number 3 and onwards?

If there's a large number of validators, having bounded channels can cause the dispatcher to wait for a single validator to have done work so there's room to insert in the channel again, by having most channels be unbounded, it can insert at will, instead of blocking causing other validators to block too waiting for just a single validator to do some work.

Edited by Marc Konig

Merge request reports