1

On my webspace I have a single folder with 10.0000 images.

Is there any difference in performance if I organize them in subfolders?

So instead of one folder /images I will have 1.000 folders /images/topic with 10 images in each folder.

3
  • 1
    Only in random ways would there be very minute differences if any at all. Note that if you are using Unix or a Unix-like operating system or Linux, they are called "directories" and not the Windows-ism of "folders" which is not the same thing.
    – Rob
    Mar 28, 2020 at 11:57
  • I'm on CentOS so it's called "directores" - you're absolutely right. Mar 28, 2020 at 12:33
  • 1
    "a single folder with 10.0000 images" - you've got an extra zero there? "I will have 1.000 folders /images/topic with 10 images" - Isn't that one extreme to the other? Why not 10 folders with 1,000 images? See also: stackoverflow.com/questions/466521/…
    – MrWhite
    Mar 31, 2020 at 17:04

1 Answer 1

1

To add to Rob's point, directories/folders are for user convenience. Although, the term folder is used by Windows, it was also used by the Mac OS in the early 90's, when Windows 3.x was still using the term directory (though the Windows 3.1 File Manager represented the directory with the picture of a folder).

Your hard disk file system uses an index to identify your file locations. While you may organize your files using directories, your files, even a single file, can be scattered in fragments/clusters all across your drive. The index keeps track of where the initial fragment is, along with the file's name. Because fragmentation can cause performance issues, we use defragmenters to try to group file fragments/clusters together.

From what I can tell, CentOS supports multiple file systems. I would identify which file system you are using and research how to optimize your specific file system. But use your directory structure to keep your sanity when searching for files.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.