[1] https://github.com/coreutils/coreutils/blob/master/src/rm.c
[2] https://github.com/coreutils/coreutils/blob/master/src/remov...
[1] https://github.com/coreutils/coreutils/blob/master/src/rm.c
[2] https://github.com/coreutils/coreutils/blob/master/src/remov...
Coreutils is not Linux, and GNU tools are notoriously heavyweight. For contrast, here is Toybox implementation of rm:
https://github.com/landley/toybox/blob/master/toys/posix/rm....
busybox:
https://git.busybox.net/busybox/tree/coreutils/rm.c https://git.busybox.net/busybox/tree/libbb/remove_file.c
And finally openbsd:
On Linux (Debian unstable in my case) you will get order of magnitude more, because rm is dynamically linked (although it seems that only with libc and nothing else), because of libc startup (did you know that linux has amd64-specific syscall arch_prctl(PRCTL_SET_FS), that does exactly what it sounds like?). And then because core utils rm cares about such things as whether stdin is terminal (probably because -f/-i behavior changes depending on that) and does the actual unlink in somewhat convoluted way that involves fstatat() (called twice, for some reason) and only then unlinkat(). Somewhat notably last thing that rm does is trying to lseek() stdin only to get ESPIPE...