Conceptually, the find utility need not perform lstat on each filename unless it's needed for matching criteria. However, find is implemented based on libbb's recursive_action, which always performs stat or lstat. This makes busybox's find excruciatingly slow compared to GNU find.
I think the easiest way to fix this is to add an extra argument to recursive_action so that the dirent d_type field can be passed, with fallback code to call [l]stat when d_type is blank or the flags are such that d_type is insufficient to determine the preferred action (i.e. when the type is a symlink and symlinks are to be followed). There may also be solutions that involve just trying an operation (e.g. opendir), but I don't think these approaches handle the full range of flags supported by recursive_action. Comments? Anyone interested in looking into this? Rich _______________________________________________ busybox mailing list [email protected] http://lists.busybox.net/mailman/listinfo/busybox
