simd-json
simd-json copied to clipboard
How to parse an immutable slice to `BorrowedValue` without cloning?
The use-case is to parse NDJSON. In NDJSON, we can split lines via a streaming iterator over the lines (to re-use the memory region), and then pass the &'self[u8] to simd-json. However, the current API seems to require a mutable slice, which a streaming iterator does not support.
Any ideas on how this can be achieved?
This isn't quite possible simd-json does in situ parsing, so the slice needs to be mutable. The possible solution I see here would be to add support for NDJSON to the carete, something that's in the TODO list but I really don't have to time to do right now. But if you want to pick that up, upstream simdjson already supports NDJSON so it should be a straight forward port and greatly appreciated contribution :)