I remember the days where GNU/Linux took like forever to finish checking a disk, which was not more than a couple of Gigabytes in size, where the same task in Windows would be done a few times faster, and how frustrating it was from an end-user’s point of view.
However, over the years, GNU/Linux has matured a lot, and these days, not only never file systems such as ‘Ext4’ can check the file systems very fast, but improved read/write performance and reduced file fragmentation are also being implemented, and in constant development.
Still, even if the file system is robust and optimized for performance, the throughput heavily depends on another low-level utility called the ‘I/O scheduler’.
Followed by its name, the task of ‘I/O scheduler’ of an operating system is to distribute disk’s ‘bandwidth’ in a way, so it delivers the best performance, while keeping the OS’s responsiveness at its highest possible, under multitasking.
I think it is due to this (rather than a ‘fault’ in the ‘Ext4’ FS when compared with ‘NTFS’), that Windows is still pretty impressive while doing things like copying files faster, but giving excellent responsiveness to other applications that run from the background.
Though it seems like it is not as good as Microsoft claims it to be, the newly introduced Windows 8 comes with an improved file copy dialog and some performance improvements (?), so I thought of doing few simple file copy based performance comparison of Windows 8 and Ubuntu 12.10.
Now, I did not use any HDD benchmarking tools mainly because of the ways that are being used by most of these tools to benchmark the HDD, under practical terms, those readings are not that accurate.
This is what I did …
So I thought of coming up with two simple file copying scenarios that would closely resemble that practical use of common file copy tasks (hopefully) carries out by the end-users, and I decided to run two tests.
First test involved copying the ‘Ubuntu 12.10’ disc image which is about 800MB in size, into another folder, on the same partition (on the ‘Desktop’ folder of the currently logged in user in both operating systems) and measuring the seconds that each OS took.
I ran the ‘test 1’ in each OS five times (in Ubuntu 12.10 first and moved into Windows 8).
Between each five tests of ‘test 1’, I rebooted the computer to avoid disk caching, otherwise the readings won’t be accurate.
The second one involved copying a folder that was about 2.3GB (again on the ‘Desktop’). It contained approximately 3436 files, that were both small and somewhat large. Again, between each five of the ‘test 2’, I made sure to reboot the computer to get accurate readings.
By based on the average readings, I came up with the below graphs.
‘Test 1’ Results …
As you can see from the above image, Windows 8 copied the 800MB disc image in twice the speed Ubuntu 12.10 did!, at an average throughput rate of 64MB per second. Where Ubuntu’s calculated speed is about 31.3MB per second.
Update (2013/07/10): I actually made a big mistake while making this claim, because I forgot to consider the fact that the partitions which are located at the outermost area of a spinning disk, always have high read/write speeds.
Now I have 3 partitions. First the Windows 8 OS partition, then another that I use to save permanent data (the largest one) and the last one for Ubuntu. And since most disk partition tools try to create partitions in an optimal layout, it is highly possible the last partition might had been created in a low performing area.
So just to check, I removed Ubuntu and then re-formatted that partition with ‘NTFS’ and re-ran the file copy test under Windows 8. And unsurprisingly, the file copy time got increased to 25-26 seconds mark, even under Windows 8. Which means that Ubuntu was not slower to copy the file, it was just that the OS was located on a slow performing area on the HDD. This should also affect (positively) the other file copy test (‘Test 2’), and Ubuntu should be able to copy small files pretty much around the same speed it copies the large files, which in return, makes it the the winner.
A special thanks goes to ‘Алексей‘ (comments) for pointing it out. And I am sorry that I forgot to take this into account, which I should have!.
‘Test 2’ Results ..
As everyone knows from their experience, a folder that is filled with thousands of, specially small files, slows down copying process due to various reasons. So if we were to copy single file that is about the same size (2.3GB in this case), then it will be copied faster than the folder that has the same size, but contains multiple files.
Anyway, the important thing that I saw was, in Ubuntu, though the file copy rate (disk I/O rate actually) went up/down, but in both these tests, the fluctuation was minimal (around 26-31MB per second in ‘Test 2’).
But in Windows 8, though it copied large files inside that folder very fast, when it came to copying small, individual files (such as saved web pages, executables etc), sometimes the speeds dropped as low as 462 KB per second! (it went down even further too).
So the end result, as you can see from the image under ‘Test 2’ is that, Ubuntu only took 86.4 seconds to copy the 2.3GB file (average disk I/O of 26MB per seconds), where Windows 8 took as long as 122 seconds! (average disk I/O of 19MB per second).
Due to its popularity, Windows has many ‘enemies’ ;-). There are millions of viruses, malware and other harmful software tools, looking for their opportunity to penetrate.
Starting with Windows Vista (if I’m not mistaken), Microsoft started to ship with a built in Antivirus tool called ‘Windows defender’. I don’t know how good the one is Windows 8, but, because ‘Avira free’ doesn’t fully support Windows 8 yet, I had it enabled this whole time.
The thing with an Antivirus program is that, they come with a feature called ‘Real-time protection’, which checks for viruses/malware etc whenever a program or data is loaded into the RAM. But the downside is that, this can slow down the computing tasks.
Though for large non executable files (multimedia files etc) might not be affected by it that much, software programs (.exe, .dll …), web page & their content etc can get affected somewhat heavily, due to the type of their content.
So because this folder had a lot of those type of files, and to be fair (as Ubuntu does not come with one), I manually disabled the ‘Windows defender’ completely (if you don’t have another antivirus program installed, then you should not do this!!) and then re-run the tests.
Though there was no noticeable difference in the ‘Test 1’, the total file copy time under ‘Test 2’ saw a 33 seconds decrease!, which is roughly a 26% increase in the performance. And this time, both Windows 8 and Ubuntu 12.10 were head-to-head, though Ubuntu was marginally ahead.
Below is the ‘new’ graph for ‘Test 2’.
Few other things …
I also, separately tested how well both operating systems responded, when opening new programs or doing things like listening to an audio track while the file copy tests were going in. One cannot accurately measure such things, without using any specially built tools, but based on the raw experience, both Ubuntu 12.10 and Windows 8 responded very well.
Final words …
Here, according to these tests, Windows 8 is clearly the winner when it comes to single, large file copying, beating Ubuntu painfully.
But while copying folders filled with large amount of individual files, Ubuntu 12.10 is the winner. The ‘1.6’ seconds reduction might not seem like much, but that is easily 14 seconds difference when moving 40GB of data. This will go up and down under Windows, depending on the type of the content, as mentioned above.
Then again, GNU/Linux is known to perform better at handling these type of operations (dealing with large number of files), thus this is not a surprise either. Under practical terms, it is impossible to run Windows without an Antivirus program, therefore, Ubuntu might be really faster in those situations (being ‘the second’ has its uses :D).
Plus, this folder also had few reasonably larger files inside. Windows 8 copied them really fast and it too should had helped closing the ‘gap’ as well. But if all it had was nothing but lots of small files, then Windows would had taken a much more long time to finish the job.
There is another thing that I want to say. I might be completely wrong here and I would love to hear others’ opinions about this, but I will say it anyway.
Under both tests, Ubuntu copied the files around the same speed. Sure in the second one, it fluctuated a bit more (it should!). But when comparing with the ‘Test 1’ and Windows 8’s statistics, the I/O fluctuation rate was very minimal. Why was that ?
Perhaps it is because of the I/O schedulers in GNU/Linux (default is ‘CFQ’ but Ubuntu 12.10 uses ‘deadline’), and they are unoptimized for those situations (copying large single files), and it is designed in such a way, where it is forced to keep an excessive amount of (relatively speaking) HDD’s I/O bandwidth, for other ‘incoming’ process, as a way of improving the responsiveness.
This approach makes sense for Server environments, but for desktops, perhaps it is time to make few adjustments (if of course this is true) …