When setting an environment variable gives you a 40x speedup
> Having thousands of files in a single directory is usually not very file system-friendly, and definitely not recommended.<p>I wonder, is this specific to the situation when I use "ls", or is it in general?<p>I recently worked on a project where I need to store many small files on ext4, although these files are not read/written by human. I came across suggestions to group files into subdirectories and not put them all in one directory. Is there evidence that it's actually worth it on a modern filesystem?<p>EDIT: by "many" I mean 10+ million files.