May 16, 2008
Vista File Copy Operations Can Be Slow
After posting a rant about Windows Vista, I thought about a way to separate perceptions from facts. In particular, I was wondering how to prove the perception that file copy operations are slow. So I fired up Delphi, added three buttons to a form, and wrote for each of them a file copy API call, like the following:
CopyFile('small.txt', 'newsmall.txt', False);
I executed this operation 100 times in a loop, wrote a large file copy one (same code, different file), added same bare bone timing and logging code, created the two sample text files (2KB and 2MB), and started running the program on Vista. The resulting is somewhat shocking, but does confirm some perceptions:
smallx100:00:04.813
smallx100:00:00.060
smallx100:00:00.061
smallx100:00:00.061
smallx100:00:00.062
smallx100:00:00.085
smallx100:00:00.061
smallx100:00:04.833
smallx100:00:00.108
smallx100:00:00.062
smallx100:00:00.063
smallx100:00:07.192
smallx100:00:00.063
smallx100:00:00.061
smallx100:00:00.059
smallx100:00:00.061
smallx100:00:00.064
smallx100:00:12.632
smallx100:00:00.071
smallx100:00:00.078
smallx100:00:00.063
smallx100:00:00.069
smallx100:00:00.063
smallx100:00:00.063
As you can see from the log above, the same operation (copying the same file 100 times) is an average quite fast, but occasionally gets incredibly slow. How can a 60 milliseconds operation take 12 seconds? It might be this happens when the indexing engine kicks in. Let's compare this with the same program running on Windows XP on a similar hardware:
smallx100:00.00.031
smallx100:00.00.031
smallx100:00.00.047
smallx100:00.00.032
smallx100:00.00.031
smallx100:00.00.031
smallx100:00.00.031
smallx100:00.00.032
smallx100:00.00.032
smallx100:00.00.031
smallx100:00.00.031
smallx100:00.00.032
smallx100:00.00.031
smallx100:00.00.031
smallx100:00.00.031
smallx100:00.00.031
smallx100:00.00.031
smallx100:00.00.032
smallx100:00.00.031
smallx100:00.00.032
smallx100:00.00.031
smallx100:00.00.031
smallx100:00.00.031
smallx100:00.00.031
smallx100:00.00.031
smallx100:00.00.031
smallx100:00.00.031
smallx100:00.00.031
smallx100:00.00.031
smallx100:00.00.031
smallx100:00.00.031
smallx100:00.00.032
smallx100:00.00.031
smallx100:00.00.031
smallx100:00.00.031
smallx100:00.00.032
smallx100:00.00.032
smallx100:00.00.031
smallx100:00.00.031
smallx100:00.00.031
smallx100:00.00.032
smallx100:00.00.032
smallx100:00.00.031
smallx100:00.00.031
smallx100:00.00.031
smallx100:00.00.031
smallx100:00.00.031
smallx100:00.00.032
smallx100:00.00.032
smallx100:00.00.031
smallx100:00.00.031
smallx100:00.00.032
smallx100:00.00.031
Notice anything? It is about twice as fast than the best Vista results (might depend on the hard drive, as well, but probably not only), but it is way more consistent: it takes always the same amount of time, with one single exception (the third value). You won't believe this is the same program and all it does is a single API call. I've tried with a themed and a non-themed application, but this doesn't seem to make a difference. However, running it at different times, the slow peaks are not always present. Still, the timing keep floating in a rather large range...
I made another test, what about running the program on the XP machine from the Vista one? Beside the warning at start up (running a program on the network is a dangerous activity these days), the program is much slower as it has to do network file operations, but the numbers are again very consistent:
smallx100:00:00.946
smallx100:00:00.926
smallx100:00:00.910
smallx100:00:01.100
smallx100:00:00.930
smallx100:00:01.106
smallx100:00:00.908
smallx100:00:01.111
smallx100:00:00.915
smallx100:00:00.918
smallx100:00:00.906
smallx100:00:00.923
A final test: What about disabling the indexing service on Vista? I disabled Windows Search service and got the following:
smallx100:00:00.060
smallx100:00:00.060
smallx100:00:00.059
smallx100:00:00.053
smallx100:00:00.177
smallx100:00:00.058
smallx100:00:00.054
smallx100:00:00.057
smallx100:00:00.052
smallx100:00:00.056
smallx100:00:00.059
smallx100:00:00.053
smallx100:00:00.211
smallx100:00:00.059
It is not it! I disabled most other Windows Vista services, and the results kept varying from execution to execution... in other words, by trial and experiment I found no way to make the program work as it does on XP. Do you want to try? I've made the program and two sample file (with part of the source code) are available in this ZIP file. Let me know if you see the same inconsistent numbers...
13 Comments
Vista File Copy Operations Can Be Slow
Roberto, good point. I failed to mention I have SP1 installed, don't know how it would have been without it.Comment by Marco Cantù [http://www.marcocantu.com] on May 16, 13:01
Vista File Copy Operations Can Be Slow
It could be interesting to use the Process Monitor (SysInternals) to look at the lowlevel IO operations. Perhaps that can shine some light on what is stealing the the time. I see the same thing on Vista SP1 - sometimes a copy or even a move of a file just takes inexplicably long time. Try comparing the built-in unzip to f.x. 7-Zip extract. Built-in takes ages and ages, while 7-zip usually is done within a few seconds.Comment by Lars Fosdal [] on May 16, 13:49
Vista File Copy Operations Can Be Slow
Do you have any anti-virus software with real-time protection running? Or is this new BitDefender thingy running and checking files in real-time? Just some ideas ...Comment by Dennis [http://blog.gurock.com/] on May 16, 14:27
Vista File Copy Operations Can Be Slow
H'm. My Vista Home Premium edition does not permit the indexing to be switched off. In the Help FAQ it says it cannot be switched off because (I paraphrase) it is a Good Thing as it speeds searching. Duh.Comment by delphi fan on May 16, 14:30
Vista File Copy Operations Can Be Slow
Here is my experience with the supefetch service on Vista : when enabling it : my laptop takes up to 45 seconds from a cold start to the logon screen when disabling it : my laptop takes up to 110 seconds from a cold start to the logon screen ! What more can I say !Comment by Stephane Wierzbicki on May 16, 15:43
Vista File Copy Operations Can Be Slow
Questions arise about virus scanners, desktop indexing engines, OS background tasks and what other types of applications are running on the system Factor changes in the realm of 1000x leads to a lot of questions about the systems involved. Personally, my perception was that when Vista isn't moving video (and trying to thumbnail it at the same time - stupid shell team!), that it is faster than XP was on the same hardware, particularilly when copying large directory trees, at least on my hardware.Comment by Xepol on May 16, 21:24
Vista File Copy Operations Can Be Slow
Here is an interesting article about Vista SP1 file copy improvements from Mark Russinovich: http://blogs.technet.com/markrussinovich/archive/2008/02/04/2826167.aspxComment by Claudio Zani [] on May 17, 11:47
Vista File Copy Operations Can Be Slow
I found something in a hidden Vista specs file: "If a user copies more than 10 files at a time, then this not likely what he wanted. He probably hit the wrong button. To make it more visible what's happening, Vista introduced a SlowCopyMode(r) which allows you to see each file while it copies." Unfortunately I cannot unveil the URL due to NDA :-)Comment by Olaf Monien [http://blogs.atozed.com/olaf] on May 17, 14:28
Vista File Copy Operations Can Be Slow
It seems that it is the new "Remote Differential Compression" who is the culprit. To turn it off go in Control Panel / Programs and features / Turn on or turn off Windows features and uncheck "Remote Differential Compression". I found out that Vista TCP/IP "Receive Window Auto- Tuning " slows network access too. To disable it, open a command prompt and type: netsh interface tcp set global rss=disabled netsh interface tcp set global autotuninglevel=disabled and reboot .Comment by Michael on May 19, 09:49
Vista File Copy Operations Can Be Slow
Remote diff compression and the netsh options seem to work for some but they have done nothing for me. I'm still waiting to upgrade my vista file copy routines to XP equivalents. The search continues...Comment by Wes on June 15, 03:32
Vista File Copy Operations Can Be Slow
Switching of Remote Differential Compression worked perfectly well for me. Copying a 20GB file (Virtual PC C: drive) from one folder to another on the same drive: before: 1,27 MB/sec. after: 9,31 MB/sec. !!!!Comment by Axel Dahmen on July 10, 17:28
Vista File Copy Operations Can Be Slow
OK.. after copying my large file for quite a while now I can say that unchecking the "Remote Differential Compression" option is just window dressing. Although speed officially increases in the copy file dialog, the estimated time of completion alters between 1 hour to 6 hours, approx. every 15 mins. Meanwhile (after approx. 50 % have been copied so far), speed has downgraded from 9.3 MB/sec. to 3.3 MB/sec., and counting.... :( It's time for a decent rant now... Bloody Vista...Comment by Axel Dahmen on July 10, 18:09
Post Your Comment
Click here for posting your feedback to this blog.
There are currently 0 pending (unapproved) messages.



Vista File Copy Operations Can Be Slow
Comment by Roberto Icardi on May 16, 12:40