1
Unix was originally designed to perform file system operations in memory, and to update the disk blocks only every 30 seconds during sync
. This resulted in a much faster user experience than MSDOS many years ago that accessed the disk blocks directly for each file system operation. But today using Windows 7 I still see that copying lots of small files takes much longer than copying one big file of the same size.
For example: a Visual Studio C# Asp web project Publish directory contains 2000 files, total 150 MB, zipped (7Zip) 90 MB.
- Copy the entire directory to the same disk: 30 seconds
- Zip: 5 seconds
- Copy one zipped file: 2 seconds
- Unzip: 65 seconds. (On another machine: 20 seconds)
Computationally, unzipping should go faster than zipping. So the unzipping might be dominated by the file system performance.
Disk fragmentation might be a factor, and the reason another similar machine might be faster in handling many file system operations. But if disk fragmentation is a factor here, it might indicate that the user has to wait for each file system operation to finish before the next one starts, i.e. like old DOS.
How Windows copies a file has not changed. But I also don't believe Windows uses the disk entirely to copy a file. – Ramhound – 2014-06-25T13:03:42.080
Trying to find info to answer my own question I found that Windows does apply disk caching: [http://msdn.microsoft.com/en-us/library/windows/desktop/aa364218%28v=vs.85%29.aspx] . But the MSDN pages are full of remarks on how to avoid caching. And we are of course not talking about 256 KB objects here. – Roland – 2014-06-25T13:25:19.677