Windows – performance penalty for having too many files in a windows folder

filesystemswindowswindows-server-2003windows-xp

On a windows OS (Server 2003, XP, Vista, Win7 etc.), is there a performance penalty for having too many files in a single folder?

  • Will a folder scan become slower (when viewing the folder in windows explorer)?
  • Will direct access become slower (copying a file in/out of this folder for example)?
  • Is there a graph that show this speed correlation to number of files?

I noticed sometimes systems with large sets of files (log files etc.) will break the files into a hierarchy of folders, with each folder holding only a small set of items. Is there a technical benefit, or a scaling consideration behind this?

Best Answer

yes and no. the larger amount of files in a directory, the longer it takes to enumerate, and the more resources it takes to enumerate.

  1. Folder scan - yes very much so, I have a server with ~65k files in it, take about 45 mins to enumerate
  2. Depends, if you are doing copy <full_path>\filename.ext <some other path> then no it doesn't take any more time if you are doing copy <full_path\filename.* <some other path> then yes as you get the same hit as enumerating the direcotry.
  3. Never seen anything like this, but never looked either.