4 ms·
It buffers all of its output statements in memory before writing to stdout: https://github.com/tomnomnom/gron/blob/master/main.go#L204 https://github.com/tomno
by haileys 3y ago
It buffers all of its output statements in memory before writing to stdout:
https://github.com/tomnomnom/gron/blob/master/main.go#L204 https://github.com/tomnomnom/gron/blob/master/main.go#L204
- codetrotter 3y agoWhy?
- mongol 3y agoIt appears to be so it can sort the lines. Not sure how useful that is however.
- loeg 3y agoIt shouldn't need to buffer the output to do that, right?
- swsieber 3y agoCorrect.
- CGamesPlay 3y agoAn ironic near-miss on the UNIX philosophy. There's a great UNIX tool that will handle sorting arbitrarily large files!
- tgv 3y agoIt will mess up array indices, though.
- codetrotter 3y agoWouldn’t “sort -n” work with indices?
- tgv 3y agoIt's tricky to specify the sorting criterium: you have to indicate the column. Gron's output looks like this: a.b[0].c.d[0]: ... a.b[0].e[0].f: ...
- xiphias2 3y agoHere's the fastgron printer if you want to compare: https://github.com/adamritter/fastgron/blob/main/src/print_gron.cpp https://github.com/adamritter/fastgron/blob/main/src/print_g...