Why is find ... -delete so much faster than rm -rf ? Specifically,
To clarify: I'm specifically asking: Why is find ./x -type d -delete && rm -rf x so much faster than rm -rf x/?
There have been a few people who use similar mechanisms, like rsync.
There are several posts on why rm -rf is slow. For example, https://unix.stackexchange.com/questions/106133/why-is-rm-slow is probably one of the most focused ones.
Specifically, I've found cd dir-to-delete && find . -type d -delete followed by rm -rf dir-to-delete is extremely fast, even on large directories.
rm -f isn't slow, but if you run it many files and you fire up a separate process per each rm, then it will be slow, because starting a process will cost you about 2ms on modern processor, and many files can be deleted in that time if you instead delete in batches, which is what find's -delete does. Alternatively, you can use xargs to run rm with a batch to pretty much the same effect.