Tencent Database Technology
Dec 27, 2017 · Fundamentals
Why ls Slows Down on Directories with Millions of Files and How to Speed It Up Using getdents
The article explains that the ls command becomes slow on directories containing millions of files because it repeatedly calls the getdents system call through readdir, and demonstrates how directly using getdents with a larger buffer can reduce the listing time from several seconds to under one second.
Performancefilesystemgetdents
0 likes · 10 min read