You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
During startup, is_valid_fd() in Python/pylifecycle.c is called to validate stdin, stdout, and stderr. Performance isn't critical here, but every bit helps in reducing startup time. In my tests, implementing this check in Windows via GetFileType((HANDLE)_get_osfhandle(fd)) is 5-6 times faster than close(dup(fd)). For example:
Activity
eryksun commentedon Nov 28, 2021
During startup, is_valid_fd() in Python/pylifecycle.c is called to validate stdin, stdout, and stderr. Performance isn't critical here, but every bit helps in reducing startup time. In my tests, implementing this check in Windows via GetFileType((HANDLE)_get_osfhandle(fd)) is 5-6 times faster than close(dup(fd)). For example:
corona10 commentedon Dec 13, 2021
New changeset 191c431 by Dong-hee Na in branch 'main':
bpo-45919: Use WinAPI GetFileType() in is_valid_fd() (GH-30082)
191c431
corona10 commentedon Dec 14, 2021
New changeset 9130a4d by Dong-hee Na in branch 'main':
bpo-45919: Remove out of date comment (GH-30090)
9130a4d