Repository navigation
Replies: 5 comments
|
If jq is too slow to parse the input(s) then you probably want to use some other tool for pruning/flattening. Which tool i guess depends on how complex the pruning/flattening criteria is. Maybe something simdjson based like fastgron could be used? maybe also worth see how gojq or jaq performs. |
|
Good pointers! Dumb test with 500 MB 12k lines JSONL. They do perform better/similar with a recipe (3-6s), with
Did some R&D, eg. extract schema to YAML, prune in text editor, then batch prune from that, but text editing felt too "unsafe". That's where the "pruning editor" came up, ie. nav tree, toggle branches, with info on variance and estimated gains. Thing is once manual pruning is done, the rest (flattening, minifying, etc.) can be automated. If no-one made this yet, maybe that's the calling? PS! Seems the reason for quoting keys is that JSON parsing is LL(1), and lookback would hurt more. So to hockey sticks with that. |
|
Did some more tests, and it seems minifying keys (and even values) has an underwhelming effect on processing time. It simply seems to be the sheer number of records that make the biggest difference. And system level disk cache(!) So preliminary conclusion:
PS! TBH, I think the optimal solution would be:
|
|
Haven't had the need for a pruning tool myself. Maybe you want to look at postgres or some other database with json support? at least postgres has a binary representation type for json and i think it can be used in indexes. If parsing time is the main issue maybe something JSON compatible like CBOR (supported by jaq), MsgPack etc could be useful? |
|
Thanks again. I'll see where this bring me. Had a go at MongoDB, and seems very suited for this type of thing. You obviously have to keep DB in sync with files. Maybe there's a built-in or supporting tool for that. If now, then quite easy to RMO. |
Uh oh!
There was an error while loading. Please reload this page.
Let's say:
Possible (combined) strategies:
All reactions