Well, I've just found out that with extensive usage of
pidof in very short intervals, the seemingly tiny tool can be a great CPU hog. (Source:
On my older machine, it can easily reach 30 percent peaks especially in batch usage, though only for a short time, but I think that for a simple task like finding the PID of a process, the footprint of such tool should be one fifth of
pidof's (if at all).
That is also why I wonder if it might be more sensible to "construct" the finding of the process ID with built-in standard tools. It would not be surprising to me if the sum of CPU load caused by executing the whole pipe managed to stay below the load caused by running
Furthermore, it would be interesting to know what is causing these high peaks. Maybe there is even somebody here amongst you guys who has dug a little deeper into the
pidof code? :)