If you use pbuilder, you probably already use cowbuilder too, in order to save on chroot instantiation time. You also probably use ccache in order to save on compilation time.
If you do that, the longest time taken by your build is, by far, the time needed to install the build-dependencies, because dpkg likes to fsync() every file it writes. It’s a good thing it does that on your main system, but in a disposable chroot you really, really don’t care what happens to it if the system crashes. Thanks to Mike, I discovered eatmydata, and tried it with cowbuilder.
If you want to try it out, add this to your pbuilderrc file:
EXTRAPACKAGES="eatmydata" if [ -z "$LD_PRELOAD" ]; then LD_PRELOAD=/usr/lib/libeatmydata/libeatmydata.so else LD_PRELOAD="$LD_PRELOAD":/usr/lib/libeatmydata/libeatmydata.so fi export LD_PRELOAD
You will also need to install eatmydata in your chroot, unless you want to regenerate it from scratch. And now you can enjoy your super-fast builds.
