I need to scan very large JSONL files efficiently and am considering a parallel grep-style approach over line-delimited text.

Would love to hear how you would design it.

  • bizdelnick@lemmy.ml
    link
    fedilink
    arrow-up
    2
    ·
    10 hours ago

    Bad idea. First, file is read sequentially, and you can’t parallelize this. Second, grep is a bad solution for structured files. Better use jq or something similar.

      • bizdelnick@lemmy.ml
        link
        fedilink
        arrow-up
        1
        ·
        8 hours ago

        Sorry, I missed that L, and I’ve never heard about JSONL before (although worked with JSON logs that are effectively JSONL). So, well, you may use grep, however it can be inefficient (depends on regex engine and how good you are in regexes). It is also easy to make a mistake if you are not very proficient in regexes. So I’d prefer using JSON parser (jq or another, maybe lower level if performance matters) over grep anyway.