ls: fix one stupid performance bug
authorAlan Cox <alan@linux.intel.com>
Mon, 12 Oct 2015 22:17:52 +0000 (23:17 +0100)
committerAlan Cox <alan@linux.intel.com>
Mon, 12 Oct 2015 22:17:52 +0000 (23:17 +0100)
commit6c4be6cdb4d147c377b5e6faf670fb1c5a137126
treeba61ee1c9dc9f767d089d0955ee45771f958543b
parent386f69c7da4110ced89e1cf736b48b5c354a582a
ls: fix one stupid performance bug

No point doing a stat on each node when we don't actually need it !

We should chdir into the directory before doing the stats on the short path.
That avoids all the name walking overhead and thrash. Likewise it might be
sensible to stat in inode order and batched, but that may cost more than
the saving !
Applications/util/ls.c