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

Optimized jsonsl_reset by removing code to reinitialize the stack #20

Merged
merged 1 commit into from
Sep 29, 2016

Conversation

snej
Copy link
Contributor

@snej snej commented Sep 26, 2016

Stack items are initialized when used (pushed) and don't need to be
zeroed out beforehand, except for the 'level' field, which can be
initialized once at creation since it's never changed.

This provides a significant performance boost when a context is used to
parse large numbers of small JSON documents. (I've got a performance
test that reads a file of 3.5M JSON objects, one per line.)

Stack items are initialized when used (pushed) and don't need to be
zeroed out beforehand, except for the 'level' field, which can be
initialized once at creation since it's never changed.

This provides a significant performance boost when a context is used to
parse large numbers of small JSON documents. (I've got a performance
test that reads a file of 3.5M JSON objects, one per line.)
@mnunberg mnunberg merged commit e21dd0a into mnunberg:master Sep 29, 2016
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.

2 participants