-
Notifications
You must be signed in to change notification settings - Fork 3
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
Allow to box messages in the channels implicitly #47
Conversation
I think the approach would work, my question would be it might be less of a 🔨 to have it on a per message type, such that one could either annotate the message enum that a subsystem consumes with a proc-macro / individual fields / the subsystem;
(obviously the naming has to be adjusted) or
such that the consumer defines the behavior of transparent boxing. Mostly ideas, feel free to discard, the impl works. |
Benchmarks from my laptop (osx): no jemalloc:
preloaded jemalloc:
So almost no difference without jemalloc (boxed version is slightly slower in all cases) and significant difference when jemalloc is loaded. |
@drahnr I think we need to decide something about this PR as it is the base for others :) I'd say that implicit boxing is a good thing for the polkadot case (jemalloc and async-channel). Per-message boxing that you suggest is not very much different from the case where an orchestra user specifies explicitly a type of message equal to |
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.
One dependency question.
Do we want to have an API to send i.e. a pre-boxed version of some messages?
Other than that LGTM (although I am not the greatest fan of the added complexity to orchestra. I'd have preferred to make it around the message types being sent, so orchestra can stay oblivious to the message type )
Hum, what do you mean? By default, orchestra does not perform implicit boxing - it must be specified explicitly in |
This PR allows to box all messages when sending them over channels. The behaviour is controlled by attribute
boxed_messages
of theorchestra
macro, for example:This change is intended to be transparent for the orchestrated subsystems.