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/sbin/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-rc3 with  ext4-patch-queue-2293e5c1161d8b5055dd32e4f8fa251d2d16b85d 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
 34.05
 39.81
 55.84

-I 256
data=writeback  34.62
 43.89
 56.42
xfs "defaults"  235.72
 37.43
 2.37
ext4
-I 256 "defaults"  31.37

 45.97

 58.72 (1)


-I 256
-O uninit_groups
"defaults"  30.55
 40.68
 1.83
-I 256
-O uninit_groups
data=writeback  30.62
 38.93
 1.81
-I 256
-O uninit_groups
data=writeback,
nomballoc
 32.79
 52.23 (2)
 1.78
-I 256
-O uninit_groups
data=writeback,
nomballoc,
nodelalloc
 34.12
 43.23
 5.15 (3)
-I 256
-O uninit_groups
data=writeback,
 i_version
 29.98
 36.52
 1.75
-I 256
-O uninit_groups
data=writeback,
i_version,
journal_checksum
 31.36
 41.27
 1.82
-I 256
-O uninit_groups
data=writeback,
i_version,
journal_async_
commit
 30.99
 35.89
(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