Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add shortcut around syscalls when file not found in win32_stat
win32_stat on success makes ~7 system calls, some from perl, some from CRT, but on failure, typically file not found, the perl syscalls fails, then the CRT stat runs, and fails too, so 5 mostly failing system calls are done for file not found. If the perl syscall says file not found, the file wont magically come into existence in the next 10-1000 us for the CRT's syscalls, so skip calling the CRT and the additional syscalls if the perl didn't find the file. This patch reduces the number of syscalls from 5 to 1 for file not found for a win32 perl stat. Benchmark and profiling info is attached to RT ticket for this patch. Note CreateFile on a dir fails with ERROR_ACCESS_DENIED so in some cases, a failed CreateFile is still a successful CRT stat() which does things differently so dirs can be opened.
- Loading branch information