-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Windows req/res very slow compared to Linux #1777
Comments
@hconcessa @rpmocchet sorry for the late reply. I'll take a look at the behavior on my Windows machine when I have time. Thanks! |
Hey Guys. So I suspected WSASocketW took so much time, and got it. for (auto rp = result; rp; rp = rp->ai_next) {
// Create a socket
#ifdef _WIN32
auto sock =
WSASocketW(rp->ai_family, rp->ai_socktype, rp->ai_protocol, nullptr, 0,
WSA_FLAG_NO_HANDLE_INHERIT | WSA_FLAG_OVERLAPPED);
/*...*/
if (sock == INVALID_SOCKET) {
sock = socket(rp->ai_family, rp->ai_socktype, rp->ai_protocol);
}
#else
auto sock = socket(rp->ai_family, rp->ai_socktype, rp->ai_protocol);
#endif
if (sock == INVALID_SOCKET) { continue; } |
There is a significant delay when connecting to localhost. It tries first to connect to 0.0.0.0 returned from |
I'm using gtest to do some performance testing. On Linux I have less than 1 ms, but the same code on Windows has ~30ms.
I think it's a significant difference, but i don't undestand why
Client
Server handle:
Common:
The text was updated successfully, but these errors were encountered: