title: Windows CreateFile slow when opening a large number of files
body: <p>I am using a directory that has about 3000 files.  I am aware of the NTFS threads that have talked about CreateFile being slow for reading files in the quantity of 100,000s or millions.  My number isn't nearly that high yet it still takes about 4-7 ms for CreateFile to complete which adds up when I'm opening 3000 files.  So my problem is similar to the post below. On some machines it is lightning fast when I invoke CreateFile and then on other ones it is this 4-7 ms speed.  I've tried Fat32 filesystem and NTFS with no luck, it is slow on both.  Same with Win7 and Win10, slow on both.  The only commonality that I have noticed is that the machines where it is slow seem to be on machines that are using SATA/RAID controllers and fast on machines that have standard SATA.  All of the machines are using SSD drives.</p>
  
  <p>As a note: I am doing the same thing as the thread below as part of my experiment.  I have a simple program that invokes CreateFile and then CloseHandle.  Does nothing else and is very slow on some machines(4-7ms CreateFile) and fast on others as described above.  The following thread is a very similar question but there was never a good answer for it.</p>
  
  <p><a href="https://stackoverflow.com/questions/21733836/why-is-windows-so-slow-in-opening-files-first-time-and-is-there-a-faster-way/45869865#45869865">Why is windows so slow in opening files first time and is there a faster way</a></p>
  
  <p>Thank you</p>
  
  <p>dgraves</p>