
On 03/24/2014 03:28 PM, Donald Alan wrote:
and used it to generate messages. My main concern is, if we are trying to send messages asynchronously (in non-ioservice thread) then the performance is significantly bad compare to sending the messages synchronously in the connection thread (of course if more and more number of clients get added
I ran your code through a profiler and it shows that the slowdown comes from boost::bind and boost::shared_ptr that are needed to setup the async operations. I also tried to change your async_server so that it does not write all buffers in a loop, but instead writes the next buffer from the handler. This yielded almost the same performance results. I also tried to omit the connection thread, so that all work is done in the io_service thread. Same performance results.