5 ms·
VS Code used 40-60 bytes per line, so a file with 15 million single character lines balloons from 30 MB to 600+ MB. kilo uses 48 bytes per line on my 64-bit mac
by shpx 1y ago
VS Code used 40-60 bytes per line, so a file with 15 million single character lines balloons from 30 MB to 600+ MB. kilo uses 48 bytes per line on my 64-bit machine (though you can make it 40 if you move the last int with the other 3 ints instead of wasting space on padding for memory alignment), so it would have the same issue.
https://github.com/antirez/kilo/blob/323d93b29bd89a2cb446de90c4ed4fea1764176e/kilo.c#L81-L90 https://github.com/antirez/kilo/blob/323d93b29bd89a2cb446de9...
- throw10920 1y ago> a file with 15 million single character lines I have never seen a file like this in my life, let alone opened one. I'm sure they exist and people will want to open them in text editors instead of processing with sed/awk/Python, but now we're well into the 5-sigma of edge cases.
- deleted 1y ago[deleted]