-
Notifications
You must be signed in to change notification settings - Fork 47
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
add microbatching to proxy forward loop #206
Conversation
add 40ms between next message in channel and draining the channel
let mut transactions_batch: Vec<Vec<u8>> = packet.transactions.clone(); | ||
|
||
'more: while let Ok(more) = per_connection_receiver.try_recv() { | ||
'drain_loop: while let Ok(more) = per_connection_receiver.try_recv() { |
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.
why do you need to specify drain_loop, seems like goto which is not required right ?
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.
it's not needed but reads more clearly IMO
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.
imo this is a bad design. if u need labels to break out loops. could be done better
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.
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 was staring a bit on the code, but so little room for improvement - can you suggest something?
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 guess I read more clearly when i read continue and break logic.
Max advices to not do that because transactions are MTU sized |
add 40ms between next message in channel and draining the channel; limit the batch size to 50
this chart (metric literpcproxy_batch_size) shows the difference between no microbatching and 40ms: batch size of 1 is without microbatching: