Skip to content

Commit

Permalink
mesh_channel_core: use transparent enum variant encodings
Browse files Browse the repository at this point in the history
Improve the mesh encoding of channel messages with
`#[mesh(transparent)]`. This improves perf for in-proc encoded send/recv
by about 15%.
  • Loading branch information
jstarks committed Jan 8, 2025
1 parent 1299c2e commit 067cb43
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions support/mesh/mesh_channel_core/src/mpsc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -772,8 +772,8 @@ type EncodeFn = unsafe fn(MessagePtr) -> Message;
#[derive(Protobuf)]
#[mesh(bound = "T: MeshField", resource = "mesh_node::resource::Resource")]
enum ChannelPayload<T> {
Message(T),
Port(Port),
#[mesh(transparent)] Message(T),
#[mesh(transparent)] Port(Port),
}

struct RemotePortHandler {
Expand Down

0 comments on commit 067cb43

Please sign in to comment.