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

Parsing optimisations #776

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

ralight
Copy link

@ralight ralight commented Aug 10, 2023

I've run the tests through valgrind with no failures. I've also run the fuzzer for over 268435456 iterations with no problems.

On my test file, the combined effect of these commits gave a 15% performance improvement in cJSON_Parse() on my 4MB test file.

Null types are almost certainly the least common object, so putting the
check last in the list will be faster.

This gave an approximate 5% performance improvement in parse_value() in
tests.
This resulted in approximately 40% reduction in instructions used in
parse_string() when parsing a 4MB JSON file, as measured in callgrind.
This gave an approximate 4% improvement in tests.
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.

1 participant