|
|
|
|
|
by e12e
720 days ago
|
|
I'm currently working with 150MB worth of gzipped JSON - marshalling the full file from JSON to ruby hash eats up a lot of memory. One tweak that allows for easier lazy iteration over the file (while keeping temporary disk Io reasonable) is to pipe it through zcat, jq in stream mode to convert to ndjson, gzip again - for a temp file that ruby zlib can wrap for a stream convenient for lazy iteration per read_line...). Generally marshalling a gig or more of JSON (non-lazily) takes a lot of resources in ruby. |
|
Is lazy marshalling something that other languages handle better?