[Declares] Fastest way to scan folders?

I believe he uses FSCatalogSearch listed here (sorry, link doesn’t scroll to the function). Everything there is marked deprecated by 10.8 though and apple recommends using Spotlight, which Thomas says is slower. Maybe equivalent uber-fast searching has been added to Spotlight since.

Spotlight also sucks in the sense that it will not dig into packages or system files, I use “Find Any File” to find .h files which are stored in Xcode.

Also on Yosemite, Spotlight freezes my system on a regular basis, especially when it automatically tries to display super huge panoramic images in its preview, makes the whole system lock up for minutes (some of my panorama images are 500mb in file size).

Have you tried this one, using WMI with oleobject:

Windows Vista and upwards

  //http://msdn.microsoft.com/en-us/library/aa387236%28v=vs.85%29.aspx
  
  Dim locator, objWMIService, objs, objProperty  As OLEOBJECT
  Dim nobjs as Integer
  
  //  Connect to WMI
  locator = new oleObject("WbemScripting.SWbemlocator", true)
  
  Dim wmiServiceParams(2) as variant
  wmiServiceParams(1) = "."
  wmiServiceParams(2) = "root\\cimv2"
  
  objWMIService= locator.invoke("ConnectServer", wmiServiceParams)
  
  // Run the WMI query
  //objs = objWMIService.ExecQuery ("SELECT * FROM CIM_DataFile where NAME = 'C:\\\\windows\\\\write.exe' ")
  //objs = objWMIService.ExecQuery ("SELECT * FROM CIM_DataFile where DRIVE = 'C:' AND PATH = '\\\\temp\\\\' AND FILENAME = 'test1' AND EXTENSION = 'odt' ")
  //objs = objWMIService.ExecQuery ("SELECT * FROM CIM_DataFile where DRIVE = 'C:' AND PATH = '\\\\temp\\\\' AND EXTENSION = 'pdf' ")
  
  // Search for all extension ini in c:\\windows No subfolder search
  objs = objWMIService.ExecQuery ("SELECT * FROM CIM_DataFile where DRIVE = 'C:' AND PATH = '\\\\Windows\\\\' AND EXTENSION = 'ini' ")
  
  //This one take some time Search also subfolders
  //objs = objWMIService.ExecQuery ("SELECT * FROM CIM_DataFile where DRIVE = 'C:'   AND PATH LIKE '\\\\Windows\\\\'  AND FILENAME = 'write' AND EXTENSION = 'exe' ")
  
  nobjs = objs.count - 1
  
  msgbox ("Found Number of files: " + str(nobjs +1))
  
  
  // For more info of file properties see link http://msdn.microsoft.com/en-us/library/aa387236%28v=vs.85%29.aspx
  For i as integer = 0 to nobjs
    Dim stringData As String
    
    objProperty = objs.ItemIndex(i)
    // ItemIndex() is not supported in Windows XP only from Windows Vista and upwards
    
    stringData = "Drive: " + objProperty.Value("Drive") + EndOfLine _
    + "Path: " +  objProperty.Value("Path") + EndOfLine _
    + "FileName: " +  objProperty.Value("FileName") + EndOfLine _
    + "Extension: " +  objProperty.Value("Extension") + EndOfLine _
    + "Name: " +  objProperty.Value("Name") + EndOfLine 
    msgbox stringData
  Next
  
  locator = Nil
  
exception err as oleexception
  msgbox err.message

OSX - with a Shell (‘find’) it is faster

ListFiles