From 067cb4369439f7107f35a64bdcd999baf9c126fb Mon Sep 17 00:00:00 2001 From: John Starks Date: Wed, 8 Jan 2025 18:07:13 +0000 Subject: [PATCH] mesh_channel_core: use transparent enum variant encodings Improve the mesh encoding of channel messages with `#[mesh(transparent)]`. This improves perf for in-proc encoded send/recv by about 15%. --- support/mesh/mesh_channel_core/src/mpsc.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/support/mesh/mesh_channel_core/src/mpsc.rs b/support/mesh/mesh_channel_core/src/mpsc.rs index d41d6c67bd..a3dd9bc649 100644 --- a/support/mesh/mesh_channel_core/src/mpsc.rs +++ b/support/mesh/mesh_channel_core/src/mpsc.rs @@ -772,8 +772,8 @@ type EncodeFn = unsafe fn(MessagePtr) -> Message; #[derive(Protobuf)] #[mesh(bound = "T: MeshField", resource = "mesh_node::resource::Resource")] enum ChannelPayload { - Message(T), - Port(Port), + #[mesh(transparent)] Message(T), + #[mesh(transparent)] Port(Port), } struct RemotePortHandler {