eliasdb icon indicating copy to clipboard operation
eliasdb copied to clipboard

Out of memory when loading a large JSON file.

Open beoran opened this issue 6 years ago • 4 comments

I have a 941MB json file I would like to import into eliasdb, but I get an out of error crash. this is because the importer tries to load the data wholesale in stead of incrementally. A way to do incremental loading from a single json file would be great.

beoran avatar Nov 28 '19 10:11 beoran

You are correct. Let me think about that ...

krotik avatar Dec 08 '19 11:12 krotik

I think you could switch to a streaming parser for JSON, maybe something like this, if you don't mind the dependency:

https://github.com/francoispqt/gojay

beoran avatar Dec 09 '19 06:12 beoran

Yeah I tend to agree about the JSON parser

Consider this one: github.com/buger/jsonparser

https://golangrepo.com/repo/buger-jsonparser-go-json

there are others also that achieve high throughput but support code gen as well

they also compile to wasm which may be useful overall

gedw99 avatar May 18 '21 16:05 gedw99

I think what would also work here is newline delimited JSON data like BigQuery is using ...

mladkau avatar May 19 '21 10:05 mladkau