4 ms·
I haven't read the code of neither sed nor tail, but I'd imagine sed is still reading line by line, while tail skips the number of lines it needs to skip, and t
by glandium 10y ago
I haven't read the code of neither sed nor tail, but I'd imagine sed is still reading line by line, while tail skips the number of lines it needs to skip, and then just goes on full throttle reading the remainder of the file. It might even be using sendfile(2) or splice(2).