…or: Why I will not copy files using a GUI
This document was inspired by a thread on a mailing-list I have subscribed. The thread was about the speed of different file-systems (ext2, ext3, reiser, xft, …) One of the folks timed the speed using the KDE-Drag'n'Drop function.
So I took the time to time different methods of copying files. I also tried different 'locations' like a regular TTY or an xterm at different window-sizes.
I did not take different file-systems into account, since I do not think that speed is an important issue when choosing the FS. If I want a logging-FS for security reasons, I don't care for the speed-penalty I get for writing that log.
I used an old P3-600 for this test. Debian Woody is installed pretty much out-of-the-box. That means that there were not much optimizations like DMA for the disks or the like.
For the tests, I copied the contents of /dev/hda1 (my root-partition) to /dev/hdb1 I used the 'time'-command for timing. Read its manual-page for details
Here are some numbers for those interested
woody:~# df -h Filesystem Size Used Avail Use% Mounted on /dev/hda1 3.9G 1.1G 2.6G 29% / /dev/hdb1 19G 1.1G 16G 7% /mnt/hdb1 woody:~# uname -a Linux woody 2.2.20-idepci #1 Sat Apr 20 12:45:19 EST 2002 i686 unknown woody:~# find / | wc -l ; # Number of files 144281
<table border="1" cellpadding="2" cellspacing="2" width="100%">
<tbody>
<tr>
<td valign="top">Command<br>
</td>
<td valign="top">Environment<br>
</td>
<td valign="top"><b>real<br>
</b> </td>
<td valign="top">user<br>
</td>
<td valign="top">sys<br>
</td>
</tr>
<tr>
<td valign="top">cp -ax / /mnt/hdb1/<br>
</td>
<td valign="top">tty, 80x30<br>
(should not matter)<br>
</td>
<td valign="top"><b>15m21.664s<br>
</b> </td>
<td valign="top">0m15.380s<br>
</td>
<td valign="top">5m6.830s<br>
</td>
</tr>
<tr>
<td rowspan="3" colspan="1" valign="top">cp -axv / /mnt/hdb1/
<br>
<br>
</td>
<td valign="top">tty, 80x30 </td>
<td valign="top"><b>22m8.563s<br>
</b> </td>
<td valign="top">0m18.730s<br>
</td>
<td valign="top">4m3.590s<br>
</td>
</tr>
<tr>
<td valign="top">xterm, 142x53 </td>
<td valign="top"><b>18m32.750s<br>
</b> </td>
<td valign="top">0m30.840s<br>
</td>
<td valign="top">5m2.450s<br>
</td>
</tr>
<tr>
<td valign="top">xterm, 80x30 </td>
<td valign="top"><b>17m27.710s<br>
</b> </td>
<td valign="top">0m30.790s<br>
</td>
<td valign="top">5m5.190s<br>
</td>
</tr>
<tr>
<td valign="top">Drag'n'Drop<br>
</td>
<td valign="top">KDE<br>
</td>
<td valign="top"><b>23m28s<br>
</b>(Hand-timed,<br>
+- 5 seconds) </td>
<td rowspan="1" colspan="2" valign="top">not available</td>
</tr>
<tr>
<td valign="top">rm -rf /dev/hdb2/*<br>
</td>
<td valign="top">tty, 80x30<br>
(should not matter) </td>
<td valign="top"><b>2m11.933s<br>
</b> </td>
<td valign="top">0m0.400s<br>
</td>
<td valign="top">0m3.210s<br>
</td>
</tr>
<tr>
<td rowspan="3" colspan="1" valign="top">rm -rfv /dev/hdb2/* <br>
<br>
</td>
<td valign="top">tty, 80x30 </td>
<td valign="top"><b>3m55.950s<br>
</b> </td>
<td valign="top">0m3.420s </td>
<td valign="top">0m4.850s </td>
</tr>
<tr>
<td valign="top">xterm, 142x53 </td>
<td valign="top"><b>2m20.204s<br>
</b> </td>
<td valign="top">0m3.040s<br>
</td>
<td valign="top">0m4.720s<br>
</td>
</tr>
<tr>
<td valign="top">xterm, 80x30 </td>
<td valign="top"><b>2m20.208s<br>
</b> </td>
<td valign="top">0m3.220s<br>
</td>
<td valign="top">0m4.940s<br>
</td>
</tr>
<tr>
<td valign="top">Drag'n'Drop</td>
<td valign="top">gmc<br>
(konqueror did play tricks on me :-)<br>
</td>
<td valign="top"><b>3m40s<br>
</b>(Hand-timed,<br>
+- 5 seconds)</td>
<td valign="top"><br>
</td>
<td valign="top"><br>
</td>
</tr>
</tbody>
</table>
It took me several attempts to hand-time the Drag'n'Drop.
I am not against GUIs. But if you need to copy a lot of files, take the keyboard. I usually try out the command with -v and when I see it works like I want it to, I hit <ctrl>+C and restart without -v. That way I can also spot error-messages, which is hard or impossible with verbose on.