Os Winda, Bit 32. Now I use FindFirstFileA Is there something faster? Rechecked, GetFileAttributesA works faster, in most cases there is something faster?

  • one
    Have you already profiled? Maybe you need to change the algorithm? And "check availability on the server" - is the server just a computer, or does it mean checking over the network? - KoVadim
  • The local network. Several servers - user210802
  • GetFileAttributes slower FindFirstFileA faster. Checking the presence of the file is the bottleneck in the program. For, if the file is on the computer itself, it searches for it quickly. Also used SearchPathA, the slowest option (For it requires as many as 6 parameters) - user210802
  • Sprawling? Then in general, that 5, that 10 servers, the difference will not be special. The truth on a hundred servers will already be slower, but not so much. - KoVadim
  • Where I wrote about parallelization? This is not required - user210802

1 answer 1

GetFileAttributes () - one API call instead of FindFirstFile () / FindClose (). Will it be faster - it is necessary to measure, but the code is exactly smaller.

  • one
    Slower, measured - user210802
  • It is strange, but so be it. - Vladimir Martyanov
  • Totally, slower. If a separate judge, quickly, yes, but not always. Somewhere in 5% of cases, the finde is looking for faster with the closure - user210802