Skip to content

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

Merged
byroot merged 1 commit intoruby:masterfrom
byroot:refactor-parser
Jan 13, 2025
Merged

Refactor JSON::Ext::Parser to split configuration and parsing state#728
byroot merged 1 commit intoruby:masterfrom
byroot:refactor-parser

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é <etienne.barrie@gmail.com>
@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