They just disabled color on servers at my work. According to this blog:
It may be due to the stat() function being called on all the different mounts in a specific directory to get the information presented by the colors...
It's easy to confirm this:
time command ls /dir/with/many/toplevel/entries/ >/dev/null
time $SHELL -c "ls --color=always /dir/with/many/toplevel/entries/ >/dev/null"
The first command, for a certain problematic directory structure I created, gives:
And the second one:
Please keep in mind that if you repeat the bottom "benchmark", its second run will have the stat() data already in cache. The second run for the colorized output gave me:
I was unable to completely clear the cache to ensure I could reproduce the "more than 90secs" result. The
vm.drop_caches sysctl as described in http://stackoverflow.com/questions/599719/how-to-clean-caches-used-by-the-linux-kernel was insufficient.