4 ms·
H tried using find, but, in this case, the libc readdir function was the bottleneck, so find doesn't help. Often, when ls is being slow, you can speed things u
by jesboat 15y ago
H tried using find, but, in this case, the libc readdir function was the bottleneck, so find doesn't help.
Often, when ls is being slow, you can speed things up drastically by disabling the things that require a stat (colors, -F, etc.) that are often added by distro's shell files (invoking ls with a full path is an easy way to disable shell aliases.) Also, sorting is on by default, which slows things for obvious reasons.
When all you need to do is kill the stat overhead for small dirs on slow file systems, "echo *" is beautifully simple.