Open neoeinstein opened 3 months ago
I wonder if there's value in more explicit boxing of Status
, or if Status
should internally box in order to reduce its size.
This seems reasonable to me, thanks! (Sorry for the delay in reviewing.)
I wonder if there's value in more explicit boxing of
Status
, or ifStatus
should internally box in order to reduce its size.
Could make sense to evaluate this next, in a separate PR? How/why is the size of Status
causing issues for you?
Closes: #1759
Motivation
Adds optional debug spans into the decoder state. At the same time, it resolves a size regression in the
State
struct, which got much larger because of the inclusion of theStatus
in the error. The size change overall is from 16 bytes (v0.11.0) to 176 (master) to 56 (this PR).Solution
Adds tracing spans at the debug level for tracking decoding of streaming messages. This should have negligible overhead when debug spans are not enabled, and provide some more context when they are enabled.
Boxes the
Status
in theError
variant to avoid size bloat for the common case.If desired, this functionality could be gated behind a feature, but I start off by avoiding the extra complexity of adding conditional compilation code.