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

Refactor JSON::Ext::Parser to split configuration and parsing state #728

Merged
merged 1 commit into from
Jan 13, 2025

Conversation

byroot
Copy link
Member

@byroot byroot commented Jan 13, 2025

Ref: #718

The existing Parser interface is pretty bad, as it forces to instantiate a new instance for each document.

Instead it's preferable to only take the config and do all the initialization needed, and then keep the parsing state on the stack on in ephemeral memory.

This refactor makes the JSON::Coder pull request much easier to implement in a performant way.

Ref: ruby#718

The existing `Parser` interface is pretty bad, as it forces to
instantiate a new instance for each document.

Instead it's preferable to only take the config and do all the
initialization needed, and then keep the parsing state on the
stack on in ephemeral memory.

This refactor makes the `JSON::Coder` pull request much easier to
implement in a performant way.

Co-Authored-By: Étienne Barrié <[email protected]>
@byroot byroot merged commit 6c603ec into ruby:master Jan 13, 2025
40 checks passed
@byroot byroot deleted the refactor-parser branch January 13, 2025 14:15
byroot added a commit that referenced this pull request Jan 14, 2025
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