tidwall / gjson.rs

Get JSON values quickly - JSON parser for Rust
MIT License
216 stars 12 forks source link

Support get_bytes #4

Open deankarn opened 2 years ago

deankarn commented 2 years ago

The main goal of this PR was to add a new function gjson::get_bytes(...) to compliment the gjson::get(...) preventing the need to convert to a string, but noticed a few other things while doing that so the highlights are:

These changes, for a project I'm using gjson in, benchmarked 5-10% faster in some situations when fetching values.

deankarn commented 2 years ago

@tidwall is there anything else needed for this PR?

P.S. Also if you feel it's too much I can make a simpler one only for supporting get_bytes in the meantime if that helps as I need it to deploy my crate :)

tidwall commented 2 years ago

Hi Dean, I appreciate the time you spent on the PR. I've only taken a cursory look and from what I can see there's some performance optimizations, which is totally awesome, but unfortunately I currently don't the time needed to do a thorough review. Hopefully in the near future. I'm not sure about the logistics of your current work, but in the meantime could there be a way to maintain a forked crate?

deankarn commented 2 years ago

Yes I could look at a forked crate for now. Unfortunate that there will be multiple published gjson crates, but not the end of the world.

Thanks for letting me know.