Hi. In Pike 7.8 calling call_out takes 0.002 ms. In Ubuntu's Pike v8.0 release 498 and in Opera's v8.0 release 610 it takes 2ms. Test program:
Seems to be a relative direct consequence of 7e8de5246b3012b055756293f2332494216646fd. /me scratches head.
It seems there are two mostly unrelated changes in that commit:
* Setting a minimum poll timeout of 2ms.
* Disabling the paranoia clear of all revents.
The commitmessage mentions a busy-loop for timing. I suspect that the problem that the code intends to fix is when there are call_outs that are pending in the interval 0ms < timeout < 1ms, where poll_timeout would get set to 0, but no call_out would be ready.
The proper fix is probably to make the code round up instead of down:
poll_timeout = (next_timeout->tv_sec * 1000) + (next_timeout->tv_usec + 999)/1000;