Benchmarks of COW directory copies and removal in [[cowbuilder]]. == Details == The numbers in the `copy` column were generated using: {{{ time sudo cp -al /var/cache/pbuilder/base.cow /tmp/new }}} and in the `remove` column: {{{ time sudo rm -rf /tmp/new }}} Everything is in seconds. XFS filesystems: || '''computer''' || '''copy''' || '''remove''' || computer details || || pc232 || 16.1 || 18.2 || Intel Core 2 Duo, ST3250820AS /dev/sda1 (10GB, xfs, 80% full), sid, i386, 2.6.22-2-686 || || pc232 || 9.0 || 10.0 || Intel Core 2 Duo, ST3250820AS /dev/sda2 (10GB, xfs, 2.4% full), sid, i386, 2.6.22-2-686 || || august || 9.3 || 10.9 || Intel Core 2 Quad, ST3320620AS /dev/sda1 (20GB, xfs, 20% full), sid, i386, 2.6.22-1-686 || || august || 5.8 || 9.5 || Intel Core 2 Quad, ST3320620AS /dev/sda3 (233GB, xfs, 0.2% full), sid, i386, 2.6.22-1-686 || || dakol || 0.48 || 0.5 || AMD Athlon 64 3800+, ST3160827AS /dev/sda7 (135GB, xfs, 32% full), sid, amd64, 2.6.16-2-amd64-k8 || || fuji || 13.9 || 16.4 || Intel Core Duo, WDC WD1600BEVS-2 /dev/sda1 (14GB, xfs, 33% full), sid, i386, 2.6.21-1-686 || Ext3 filesystems: || '''computer''' || '''copy''' || '''remove''' || computer details || || pc232 || 0.2 || 0.14 || Intel Core 2 Duo, ST3250820AS /dev/sda2 (10GB, ext3, 2.4% full), sid, i386, 2.6.22-2-686 || || august || 0.22 || 0.13 || Intel Core 2 Quad, ST3320620AS /dev/sda5 (42GB, ext3, 0.9% full), sid, i386, 2.6.22-1-686 || || dakol || 0.22 || 0.15 || AMD Athlon 64 3800+, ST3160827AS /dev/sda5 (2GB, ext3, 14.5% full), sid, amd64, 2.6.16-2-amd64-k8 || Ext4 filesystems: || '''computer''' || '''copy''' || '''remove''' || computer details || || ca || 0.23 || 0.1 || Intel Core 2 Quad, WDC WD10EADS-00L /dev/mapper/ca-home (46GB, ext4, luks encrypted, 21% full), sid, amd64, 2.6.31-1-amd64 || Note 1: All copies were done on the same partition, the number of which is noted in the `computer details` column. Note 2: XFS filesystem was created using mkfs.xfs, ext3 filesystem was created with mkfs.ext3. No options added. Note 3: On `dakol` with XFS filesystem, cp takes 0.5s, `sync` takes 3s (!), rm takes 0.5s, and another `sync` takes 2.8s. However, with the ext3 filesystem on the same system, the `sync` is negligible. On `august` with ext3, cp takes 0.2s, `sync` 0.2s, rm 0.09s, `sync` 0.18. Note 4: All tests were run several times and the deviation is usually around 10%. So instead of 16s, it could also be 15s (but not 10s), and instead of 0.22s, it could be 0.24s (but not 1s). == Research == We just discovered, that mounting XFS partition with: {{{ sudo mount -o nobarrier /dev/sda2 /mnt/p1 }}} speeds things up on all machines. The reason is, that the option "-o barrier" was added by default to all kernels >= 2.6.17, so dakol has nobarrier, all the others have barrier. By mounting with nobarrier, the cp and rm times are around 1.7s. That's a-ok. == Conclusion == The ext3 filesystem is truly superior to XFS for the `cowbuilder` purpose. Just use it and you'll be fine.