simdjson-rust
This crate currently uses simdjson 3.2.3
. You can have a try and give feedback.
If you
- find certain APIs are missing
- encounter memory errors
- experience performance degradation
Please submit an issue.
Usage
Add this to your Cargo.toml
# In the `[dependencies]` section
= "0.3.0"
Then, get started.
use *;
use ;
dom
and ondemand
simdjson
now offer two kinds of API, dom
and ondemand
.
dom
will parsed the whole string while ondemand
only parse what you request.
Due to ffi
, the overhead of ondemand
API is relatively high. I have tested lto
but it only improves a little :(
Thus it is suggestted that
- use
ondemand
if you only want to access a specific part of a large json, - use
dom
if you want to parse the whole json.
padded_string
simdjson
requires the input string to be padded. We must provide a string with capacity = len + SIMDJSON_PADDING
.
We provide utils to do so.
use *;