This what what happens when you call: Directory.GetFiles(path)
Directory.GetFiles(path, "*")
Directory.GetFiles(path, "*", SearchOption.TopDirectoryOnly)
InternalGetFileDirectoryNames(path, path, "*", true, false, SearchOption.TopDirectoryOnly);
Which within its own right isn't horrible. But then InternalGetFileDirectoryNames() spends 50% of its processing time doing this: Path.CheckSearchPattern("*");
So I didn't request a search pattern and yet I'm spending 51% of the call checking one for validity. That is a poor design if you ask me. All they needed to do was add this:
if(searchPattern.Length != 1 || searchPattern[0] != '*')
Path.CheckSearchPattern(searchPattern);