On 2/13/06, Andrew Pinski <[EMAIL PROTECTED]> wrote: > > On Feb 13, 2006, at 10:00 PM, Jason Crawford wrote: > >> > >> Time to write your own program in C instead if the time to invoke > >> rm is taking too much time. > > > > No point, xargs does what I need it to do, and is much more efficient > > than having find execute rm itself. The fewer times you call execve(2) > > the better. > > > One execve is enough? Then rewriting the script into C will save > all execve. Do you think rm(1) does anything special, > other than remove(3)?
You misunderstand. find calls execve(2) for every file it finds matching the criteria, where as xargs will only execve(2) once either the pipe is closed or it hits the max args. That's A LOT fewer execve(2) calls. And rm calls unlink(2), as remove(3) would waste even more resources. Jason