If you read the whole file, then process that file, the program first blocks on disk I/O for the time it takes to read the file, then it blocks the CPU for the time it takes to process it.
By streaming the data, you can do both at the same time. (The OS will already fetch the next line from the disk while you are still processing the previous one.)
By streaming the data, you can do both at the same time. (The OS will already fetch the next line from the disk while you are still processing the previous one.)