4 ms·
The example was a multi-gigabyte CSV file. You just sucked the whole thing off the disk into RAM so that you could shave off the first line. If you're unlucky
by alrs 12y ago
The example was a multi-gigabyte CSV file. You just sucked the whole thing off the disk into RAM so that you could shave off the first line.
If you're unlucky, you started swapping out to disk about halfway through.
- chrishynes 12y agoWrong. ReadLines returns an IEnumerable<string> and lets you read line by line without loading the entire file into memory: http://msdn.microsoft.com/en-us/library/dd383503%28v=vs.110%29.aspx http://msdn.microsoft.com/en-us/library/dd383503%28v=vs.110%....
- recursive 12y agoThat code you're replying about was carefully and correctly written. You just replied as if you know how it works just so you could look like you know what you're talking about. If you're unlucky, someone who actually knows how File.ReadLines() works will show up in an hour or two and explain that it's lazily evaluated.
- alrs 12y ago:) touche