2 is likely to be faster, but there probably isn't as much difference in it as you might expect. Method 1 is unlikely to cause a disk seek on each line because in both 1 and 2 it's all memory cached until something causes the file to be flushed. So the difference is memory allocation and function call overhead, not disk hardware times.