title: What's the fastest way to recursively search for files in python?
body: <p>I need to generate a list of files with paths that contain a certain string by recursively searching. I'm doing this currently like this: </p>
  
  <pre><code>for i in iglob(starting_directory+'/**/*', recursive=True):
      if filemask in i.split('\\')[-1]: # ignore directories that contain the filemask
          filelist.append(i) 
  </code></pre>
  
  <p>This works, but when crawling a large directory tree, it's woefully slow (~10 minutes). We're on Windows, so doing an external call to the unix find command isn't an option. My understanding is that glob is faster than os.walk. </p>
  
  <p>Is there a faster way of doing this? </p>