Skip to content

Commit

Permalink
mesh_channel_core: use transparent enum variant encodings (#631)
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 authored Jan 8, 2025
1 parent 8cf8aa4 commit 41307a5
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions support/mesh/mesh_channel_core/src/mpsc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -777,7 +777,9 @@ type EncodeFn = unsafe fn(MessagePtr) -> Message;
#[derive(Protobuf)]
#[mesh(bound = "T: MeshField", resource = "mesh_node::resource::Resource")]
enum ChannelPayload<T> {
#[mesh(transparent)]
Message(T),
#[mesh(transparent)]
Port(Port),
}

Expand Down

0 comments on commit 41307a5

Please sign in to comment.