On 1 July 2011 17:00, Steven McCoy <[email protected]> wrote: > The rate engine can cause a lot of churn as OS sleep calls are not that > efficient yet. This means some of that CPU usage can be taken away and you > will see no performance difference. > > One option you may wish to test, if the CPU usage is a greater concern than accuracy of the rate limiter, is changing the timeout rounding:
In *pgm_socket.cpp* find the timeout conversion for TX and RX sockets: const long timeout = (tv.tv_sec * 1000) + (tv.tv_usec / 1000); If you want fairer rounding, which might moderately reduce load: const long timeout = (tv.tv_sec * 1000) + ((tv.tv_usec + 500) / 1000); If you want rounding up, which significantly helps Windows: const long timeout = (tv.tv_sec * 1000) + ((tv.tv_usec + 999) / 1000); It may be worth implementing as a socket option in the future. -- Steve-o
_______________________________________________ zeromq-dev mailing list [email protected] http://lists.zeromq.org/mailman/listinfo/zeromq-dev
