Windows Filenames & File/Directory Sizes

Do long filenames and/or large directories slow down a computer's performance?
In one word, C:\X123_ades11_4_dfag1_1345_122\X123_ax15_1343(p012)_wa1234_x6tc123a234_c112_x23_y11.YES!

In the Days-of-Olde, Microsoft had a neat little convention of 8.3.  Eight character filename prefix and 3 character suffix (extension).  As the operating systems grew, so did the filename lengths.  Microsoft has since given us more than enough flexibility to really screw ourselves up.

When saving a file with a long filename to an
NTFS (New Technology File System) drive, NTFS creates a secondary file entry with a shorter filename conforming to the 8.3 convention.  The reason for this to allow older operating systems which cannot handle the larger names to index the file.  When NTFS enumerates files in a directory, it has to look up the 8.3 names associated with the long file names.  And because an NTFS directory is maintained in a sorted state, corresponding long filenames and 8.3 names are generally not next to one another in the directory listing. So, NTFS uses a linear search of the directory for every file in the volume. As a result, the amount of time required to perform a directory listing increases as a function of Square-Law.  Keeping in mind, this is in addition to the slow indexing due to the long filenames.

If you must use long filenames it would be beneficial disabling the 8.3 file creation.  Two registry keys will need to be changed:
NtfsDisable8dot3NameCreation and NtfsDisableLastAccessUpdate  Set their values to 1.  Keep in mind, doing so may prevent longer filenames from working with older computers.

Performance Test is a program I put together to test the performance of the computers using either long files and/or lots of files and directories.  Basically it just creates a bunch of zero length files & directories and spits out the number of Operations Per Second (OPS).  FOPS being Files Operations Per Second and DOPS for Directory Operations Per Second.  Each experiment was done twice; one set with 36 character names, and the other with 144 character names.

  It is easy to see the difference between long and short file names.  The long file names seems to slow down the operation down about 30 -40%.  Keeping in mind, this is on a PC.  It will almost definitely be slower over a Network.  What is also interesting is how the OPS seems to take a hit around the 200 -500 file/directory mark.  I have seen this mentioned before in other articles but no one mentions why.  If I find some time I will look into it further.

So for my buddy Mike, here ya go, proof positive!



NTFS vs FAT vs exFAT

Criteria

NTFS5

NTFS

exFAT

FAT32

FAT16

FAT12

Operating System Windows 2000
Windows XP
Windows 2003 Server
Windows 2008
Windows Vista
Windows 7
Windows NT
Windows 2000
Windows XP
Windows 2003 Server
Windows 2008Windows Vista
Windows 7
Windows CE 6.0
Windows Vista SP1
Windows 7
WinXP+KB955704
DOS v7 and higher
Windows 98
Windows ME
Windows 2000
Windows XP
Windows 2003 Server
Windows Vista
Windows 7
DOS All versions of Microsoft Windows DOS All versions of Microsoft Windows
Limitations
Max Volume Size 264 clusters minus 1 cluster 232 clusters minus 1 cluster 128PB 32GB for all OS. 2TB for some OS 2GB for all OS. 4GB for some OS 16MB
Max Files on Volume 4,294,967,295
(232-1)
4,294,967,295
(232-1)
Nearly Unlimited 4194304 65536  
Max File Size 264 bytes
(16 ExaBytes) minus 1KB
244 bytes
(16 TeraBytes) minus 64KB
16EB 4GB minus 2 Bytes 2GB (Limit Only by Volume Size) 16MB (Limit Only by Volume Size)
Max Clusters Number 264 clusters minus 1 cluster 232 clusters minus 1 cluster 4294967295 4177918 65520 4080
Max File Name Length Up to 255 Up to 255 Up to 255 Up to 255 Standard - 8.3
Extended - up to 255
Up to 254
File System Features
Unicode File Names Unicode Character Set Unicode Character Set Unicode Character Set System Character Set System Character Set System Character Set
System Records Mirror MFT Mirror File MFT Mirror File No Second Copy of FAT Second Copy of FAT Second Copy of FAT
Boot Sector Location First and Last Sectors First and Last Sectors Sectors 0 to 11 Copy in 12 to 23 First Sector and Copy in Sector #6 First Sector First Sector
File Attributes Standard and Custom Standard and Custom Standard Set Standard Set Standard Set Standard Set
Alternate Streams Yes Yes No No No No
Compression Yes Yes No No No No
Encryption Yes No No No No No
Object Permissions Yes Yes Yes No No No
Disk Quotas Yes No No No No No
Sparse Files Yes No No No No No
Reparse Points Yes No No No No No
Volume Mount Points Yes No No No No No
Overall Performance
Built-In Security Yes Yes Yes minimal ACL only No No No
Recoverability Yes Yes Yes if TFAT activated No No No
Performance Low on small volumes High on Large Low on small volumes High on Large High High on small volumes Low on large Highest on small volumes Low on large High
Disk Space Economy Max Max Max Average Minimal on large volumes Max
Fault Tolerance Max Max Yes if TFAT activated Minimal Average Average
FAT Chart reprinted with permission of www.NTFS.com