Boost logo

Boost Users :

Subject: Re: [Boost-users] boost asio synchronous vs asynchronous operations performance
From: Bjorn Reese (breese_at_[hidden])
Date: 2014-03-25 09:06:49


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.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net