How Can JavaScript Handle Large Amounts of JSON Data Quickly?

33 Views Asked by At

I'm working with big JSON data for a web project. It's a lot and makes my browser slow. I need help with:

  • Fast ways to use big JSON data without slowing down the browser.
  • How to not use too much computer memory.
  • Can I work on the data bit by bit instead of all at once?

i have tried JSON.parse()

Looking for simple tips or tools. Thanks!

1

There are 1 best solutions below

0
Alexander Nenashev On

There's no simple tools I guess.

You can use any 3rd party JSON streaming parsers like

https://www.npmjs.com/package/stream-json

to parse some initial chunk of data.

A comprehensive list is here:

https://github.com/nodejs/node-v0.x-archive/issues/7543#issuecomment-41970902

You could also move your fetching and parsing into a worker.

But the question is why you need such big data in the first place.