Skip to content

Possible to stream chunks of JSON data? #222

Description

@timendez

Hi, I was consuming a 25gb JSON file (array of objects) and I was profiling my code to try and improve performance:

let second = false;
oboe(myDataStream)
    .node('!.*', myObject => {
      if (second) {
        console.timeEnd('stream');
        process.exit();
      }
      // business logic in here...
      second = true;
      console.time('stream');
      return oboe.drop;
    })

and it takes about 1ms on average per object, which is the bottleneck of my code.

Is there a way where I can have .node send me a chunk of like 500 objects? Or would that not improve performance anyway since technically oboe has already done a large chunk of IO?

Thanks!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions