Closed Syrco closed 9 months ago
Generally I like this approach. I need to make sure it works as expected, and also cross platform. I any case you will need to change the indentation to use tabs instead of spaces.
I've fixed the indentation
@nikias Is there anything else I can do to help? Should I squash the commits?
@Syrco no, but I noticed a small performance drop with this solution and I am trying to figure out if I can improve it.
Hello, It has been almost a year since this ticket was last commented on. Are there any updates? It would be good to know if the small performance issue got worked out, or even, what the magnitude of the drop was.
Couldn't get around making it faster, but it was noticeable performance drop. Need to investigate again.
The other issue is that Windows (via Winsock API) has select()
but not poll()
, so we need to make it use poll only on platforms that support it.
@Syrco are you still tracking this? Wondering if you would be prepared to make a change so that poll() over select() is a runtime selectable strategy? From what nikias said it sounds like most users would prefer it to stay the same, except for when you absolutely need more than 1024 file descriptors.
I am fine with poll() if I don't have any performance drop. Need to verify again. Other than that we can ifdef it for windows and keep using select.
Found the bottleneck which is literally just having the compiler inline the additional function, then it should be good. Working out the select/poll conditional compilation now.
Merged with bbc3c4e58f7991495e885b38a03fd20abecd4583 and 2d517ebcebe326e79186e41ee7bbd1cf5ed1f2b9.
Thank you.
This happens, for example, when a process links with libusbmuxd, and the process is file descriptor heavy. Note: 'poll' means the syscall poll, not a polling approach. This patch does not add a busy wait and is not a performance regression.