3 ms·
Interesting. My guess: speed up is due to buffering involved in the latter's case, not sure though.
by legends2k 3y ago
Interesting.
My guess: speed up is due to buffering involved in the latter's case, not sure though.
- tyingq 3y agoThere's probably more than one reason it's faster. For example, tar ignores extended file attributes by default. Cp -r would have to check them for every file.
- mortehu 3y agoIt's because reading and writing happen in separate processes, i.e. simultaneously instead of interleaved. In general writing to disk is handled asynchronously by the kernel (`write` just copies to a buffer and returns), but metadata operations like creating files are not, so this should help the most for many small files.