4 ms·
My guess that windows is in a loop of reading bytes from the source and writing the bytes to the destination. As munin mentions, the appropriate transaction siz
by spiantino 15y ago
My guess that windows is in a loop of reading bytes from the source and writing the bytes to the destination. As munin mentions, the appropriate transaction size of writes to a device will be related to how much data the CacheManager chooses to allow to be buffered and not flushed to the actual device. Which is huge for a hard disk and very small for a usb drive since windows expects it might be pulled from the port at any point.
Now, consider that calling read() on a socket that's really an SMB share is a complicated, multi-round trip action. The read must involve some locking in case someone else tries to write to the file in between, and probably a ton of other stuff. In my experience, even doing something like opening a 5k php file in vim from a samba mount can take a few seconds. That overhead is getting paid far more often in the network -> USB case than it is in the network to HD case.
- SoftwareMaven 15y agoIn short, windows uses smaller packets for USB, necessitating many more network roundtrips. That seems like a very reasonable hypothesis. I'm not sure how MS could solve it without using arbitrary amounts of memory or caching on the HDD, which would be a really bad solution, IMO.