in reply to Re^2: Unix shell ls vs readdir
in thread Unix shell ls vs readdir

I don't know what "the 2Lac of files" is supposed to mean, and "performance" is either too dependent on unknown factors, or else simply irrelevant. Enough practical reasons have been cited to favor the readdir/readlink approach (ease and reliability of file name handling, vs. somewhat more difficult and trouble-prone string parsing), and in some circumstances, running a subshell to run "ls" could be slower than using readdir/readlink.

If a timing difference between the two methods really matters (which is rarely true), then doing a benchmark "in context" (i.e. under the same conditions as production use) would be prudent.

Replies are listed 'Best First'.
Re^4: Unix shell ls vs readdir
by GrandFather (Saint) on Feb 07, 2012 at 21:22 UTC