prataprc / jsondata

JSON processor
https://docs.rs/jsondata
MIT License
9 stars 3 forks source link

Alternate parsing, assuming ASCII encoding for JSON string. #3

Open prataprc opened 5 years ago

prataprc commented 5 years ago

JSON Strings can be unicode encoded and parsing them can be costly: For example

for r#""汉语 / 漢語; Hàn\b \tyǔ ""#

bench_string:  771 ns/iter (+/- 213)

By not supporting unicode encoded string, we can improve the performance of JSON deserialisation.

Right now parse_string() handles string parsing for JSON. Implement parse_ascii_string() as alternate feature.