Kernel Build Tests: comparison of ext3, ext4 and xfs


Test bed:

 Tests are done on a bi-Xeon machine with 2G of RAM and with hyper-threading enabled (4 CPUs).
processor      : 4
vendor_id      : GenuineIntel
cpu family     : 15
model          : 4
model name     : Intel(R) Xeon(TM) CPU 2.80GHz
cpu MHz        : 2793.078
cache size     : 1024 KB
bogomips       : 5586.59

Partition size: 68 GB (sdc1) SCSI ultra320 10 000rpm
# hdparm -t /dev/sdc1
/dev/sdc1:
 Timing buffered disk reads:  202 MB in  3.01 seconds =  67.10 MB/sec

Synopsis:

The partition used is formated with mkfs and mounted with appropriate options before each run.
The script used is a kernel build sequence:
cp /home/linux.tar.bz2  .
/usr/bin/time -f "%e" sh -c "tar xjf linux.tar.bz2 && sync"
/usr/bin/time -f "%e" sh -c "make defconfig && make -j8"

After the kernel build,  read all files
umount, mount the filesystem # to flush the caches #
/usr/bin/time -f "%e" tar cf /dev/zero linux

Then run e2fsck on the filesystem (xfs_check for xfs filesystem)
umount the filesystem
/usr/bin/time -f "%e" e2fsck -fy /dev/sdc1


Results

The following table summarizes the results for each filesystem. All numbers represent the average of three tests.
Kernel compilation time is not reported here as it is constant whatever the filesystems and options. For the other commands, the elapsed real time is in seconds.


Kernel: 2.6.24-rc4 with ext4-patch-queue-36c747b11f3b4059924c661ab0273ae1db11cdc8 applied:

Elapsed real time in seconds of "tar xf", "tar cf" and fsck commands

mkfs options
mount options   tar xjf
linux.tar.bz2 
  tar cf linux    
 fsck
ext3
-I 256
33.02
37.96
51.49

-I 256
data=writeback 35.69
43.96
58.88
xfs "defaults" 232.49
37.37
2.63
ext4
-I 256 "defaults" 30.94
41.18
59.66 (1)

-I 256
-O uninit_groups
"defaults" 31.18
44.18
1.90
-I 256
-O uninit_groups
data=writeback 31.05
36.67
1.73
-I 256
-O uninit_groups
data=writeback,
nomballoc
33.87
57.30 (2)
1.88
-I 256
-O uninit_groups
data=writeback,
nomballoc,
nodelalloc
34.82
46.43
5.37 (3)
-I 256
-O uninit_groups
data=writeback,
 i_version
30.69
36.70
1.70
-I 256
-O uninit_groups
data=writeback,
i_version,
journal_checksum
31.03
35.87
1.73
-I 256
-O uninit_groups
data=writeback,
i_version,
journal_async_
commit
30.69
36.01
(option
journal_async_
commit
not recognized)


(1) This value compared to the others below shows the speedup gained by using the uninitialized block groups feature.

(2) See http://marc.info/?l=linux-ext4&m=119365211419498&w=2

(3) When mount options are "data=writeback, nodelalloc, nomballoc", e2fsck reports:
/dev/sdc1: 27939/8936928 files (3.9% non-contiguous), 725683/17871210 blocks
    When mount options are "data=writeback", e2fsck reports:
/dev/sdc1: 27939/8936928 files (0.1% non-contiguous), 725605/17871210 blocks