Andi Kleen <[EMAIL PROTECTED]> wrote: > While debugging an operating system kernel I noticed that the first > program using floating point in a typical linux startup is rm. This > seems to be used for the hash table sizing of the hash table to detect > loops in recursive rm, which is initialized in all cases even for non > recursive rm. > > To speed up/clean up rm minimally I would suggest: > - only initialize the hash table when recursive rm is requested.
Thanks for the suggestion! > - use a default size for the hash table and do not use floating point to > set it up. Is it really worth worrying about whether rm performs a few floating point operations? Yes, we could avoid them pretty easily, but is it worthwhile? > Also I think there are better algorithms to detect loops than this which > do not need such a complicated hash table. One nice way is to just keep > a running counter of all files deleted and set a mark in a stack for > each power of two crossed in the counter. Then check the current file > always against the mark. This is guaranteed to detect every loop, > although a bit lazily. Good idea! I've implemented it for the next test release. _______________________________________________ Bug-fileutils mailing list [EMAIL PROTECTED] http://mail.gnu.org/mailman/listinfo/bug-fileutils