3 ms·
Only if you have multiple layers of depth. You can easily have a single layer and then its a flat loop to list everything and broken up in to multiple much fast
by SilverRed 5y ago
Only if you have multiple layers of depth. You can easily have a single layer and then its a flat loop to list everything and broken up in to multiple much faster operations.
I haven't looked in to the details but one system I can imagine is hashing the file names and then placing the file in the folder named with the first x parts of the hash. Then to look up you can use the filename to work out exactly which folder the file is in and you never exceed a set limit for files in one folder.
If we say 3000 files is perfectly safe in a single folder, 3000 folders with 3000 files holds 9M files.