On Mon, Oct 16, 2023 at 2:59 PM Dragan Simic <dsi...@manjaro.org> wrote:
> Wouldn't that actually introduce a significant performance overhead?

Only if both (a) the appropriate options were set in LS_COLORS and (b)
colorized output is being generated.

I could be wrong, but it appears that `ls` already calls stat() on
each entry.  So the additional cost would be calling stat() on each
parent.  In the common case, there is only one parent, and many
children.

It is possible that in some cases, there are many parents.  In these
cases, there would be many additional calls to stat().  (Unless `ls`
is already calling stat() on each parent.  I haven't looked at the
code closely enough to know.)

Cheers,

Parke

Reply via email to