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

validate utf-8 string #531

Merged
merged 2 commits into from Feb 6, 2020
Merged

validate utf-8 string #531

merged 2 commits into from Feb 6, 2020

Conversation

dota17
Copy link
Member

@dota17 dota17 commented Jan 10, 2020

plan 2: validate utf-8 string during parsing string. #122
Validate fuction has been added into macro PEEK_CHAR(dest, tok) .

@dota17
Copy link
Member Author

dota17 commented Jan 20, 2020

  1. Add a new JSON_TOKENER_VALIDATE_UTF8 (default:0x10) flag and optimize the validate function.
  2. performance testing:

2020-01-20_095404

I test it with nativejson-benchmark 10 times. The conventional parse time without utf-8 validation is 105ms and the average parse time with utf-8 validation is 108.1ms. I think it's a acceptable result. @hawicz

@dota17 dota17 changed the title plan 2 : validate utf-8 string validate utf-8 string Jan 20, 2020
@hawicz hawicz merged commit 0ffdbb2 into json-c:master Feb 6, 2020
@dota17 dota17 deleted the utf8test branch April 17, 2020 02:29
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

Successfully merging this pull request may close these issues.

None yet

2 participants