News for hackers. Stuff that matters.
Re:When your data doesn’t fit in memory: the basic techniques by xondono on Tuesday November 12, 2019 @03:41AM (#21512565)
Not an expert, but after reading around OP is saying you only need a constant sized buffer (that could be as little as a character deep) to read the whole file looking for line breaks. This roughly takes O(1) space (A lot of commenters are confusing time vs space requirements) but there's a little nitpick to be found, in extremely big files the line counter itself would be O(log(n)) and would dominate.
Re:When your data doesn’t fit in memory: the basic techniques by bogomipz on Tuesday November 12, 2019 @09:14AM (#21514211)
I see, yes that makes sense. The conflation with time instead of space was confusing me. Thanks.