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

Adds a slurp mode for reading the full file #91

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rjp
Copy link

@rjp rjp commented Jan 13, 2022

Using the slurp option -- -S, -slurp -- causes gron to read all the
data into RAM before processing. Tested on a 102M JSON file - memory
usage is about 400M for parsing the first object.

Fixes #70 (in a fairly sledgehammer way, I suppose, but it's easier for
people to deal with "read the whole file" than try to guess a number for
a buffer size, especially if you don't know the file size in advance.)

Tests pass but linting doesn't but then agan linting also doesn't pass on
the unmodified master either because gometalint is broken these days.

Using the slurp option -- `-S`, `-slurp` -- causes gron to read *all* the
data into RAM before processing.  Tested on a 102M JSON file - memory
usage is about 400M for parsing the first object.

Fixes tomnomnom#70 (in a fairly sledgehammer way, I suppose.)
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.

Scanner error: token too long
1 participant