Fastest way searching specific files
Try parallelization. Instead of:


foreach (DirectoryInfo di in subDirs)
{
    WalkDirectoryTree(di, searchname);
}



Do

Parallel.ForEach(subDirs, dir =&gt; WalkDirectoryTree(dir, searchname));


Notice that by doing this allFiles will be accessed concurrently so change your collection to a ConcurrentBag.