[prev in list] [next in list] [prev in thread] [next in thread]
List: busybox
Subject: recursive_action (and thus find) slow due to [l]stat()
From: Rich Felker <dalias () aerifal ! cx>
Date: 2013-05-29 4:12:40
Message-ID: 20130529041240.GA23941 () brightrain ! aerifal ! cx
[Download RAW message or body]
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
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic