Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add documentation to explain how to use this library? #375

Open
nk9 opened this issue May 28, 2024 · 1 comment
Open

Add documentation to explain how to use this library? #375

nk9 opened this issue May 28, 2024 · 1 comment

Comments

@nk9
Copy link

nk9 commented May 28, 2024

I am exploring adopting simd-json for parsing GeoJSON files in the geojson library. However, I'm having trouble understanding how this library is meant to be used. I thought it would be a drop-in replacement for serde (given that it falls back to serde for parsing when SIMD instructions aren't available). But when I just replace use serde::{etc} with use simd_json::{etc}, it turns out that simd_json doesn't export Deserialize, Serialize or Serializer. So clearly there's more to it.

The examples directory has just a single file in it, which is actually a benchmarking exercise. It's not clear from that code how to convert a serde_json implementation to one using simd-json.

The one glimmer of explanation I have found is in the Serde Compatible API section of the docs, but it has a warning saying that it's untested!

So I'm hoping I can get a pointer to some documentation or example code for how to acutally use this library to speed up an existing serde_json implemtation. Thanks in advance.

@Licenser
Copy link
Member

Hi,

that's a bit misleading wording in the hint from docs.rs, it doesn't mean it's an untreated feature but that we do not run that example during normal unit tests you can use the serde interface it's well tested and stable.

It's also worth looking at https://github.com/simd-lite/simd-json-derive ; it only supports a subset from serde derives features but directly integrates with simd-json and is often significantly faster

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants