fd is 4x slower(even 167x slower) than find when to delete files
Test case: delete 15369 files from a directory
See the ad-hoc tests in the image:
Amazing to find 'find with -delete option' is so fast.
fd version: 10.2.0 find version: 4.5.11
One obvious reason is that fd is spawning a new process for every file, whereas find makes the syscall directly with the -delete flag. Using the --exec-batch option to pass all the files to rm at once instead of executing rm individually for each would probably help.
Although I don't know why find with -exec rm is so much faster.
Although I don't know why find with -exec rm is so much faster.
I'm guessing it's because fd runs them in parallel, but there may be some kernel/fs contention when deleting inodes. Is fd faster with -j1?