simd-json
simd-json copied to clipboard
"pluck" or "nested get" functionality?
I have a need for very high speed access to fetch a couple fields within a deeply nested JSON blob, I would prefer not to have to deser the entire blob for only a couple of fields.
Is there a way to accomplish something like:
let blob: &str = get_deep_json_string();
let total: i64 = simd_json::pluck("foo.bar.baz.total", blob)?;
let mystr: &str = simd_json::pluck("foo.wat.huh.summary", blob)?;
After writing that, I guess this would equate to adding json-path functionality, or similar, which sounds far less trivial than I originally thought. The existing json-path libs in Rust do require deserialization into a serde-json Value first, which certainly doesn't offer the perf benefits that I'm after.
One option that might work well is delserialize to a tape (that's fairly cheap) and then get the value from the tame?
closing as a duplicate of #82 since no objection was made to using the tape