On Wed, May 6, 2015 at 5:17 PM, ovsyannikov vladimir
<
vladimir.o...@gmail.com> wrote:
> I don't have any kind benchmark and I think it's not so easy to prove a
> speed reduction(all frameworks add additional overhead so it's not so easy
> to find a root cause and so on).
> But I'm curious why the design decision has been made. For me it's more
> logical to have one actor to read from a socket and another to write.
The design decision was mostly for simplicity. Both of the API (Why
should the user-actor send Writes to a different actor than it
receives the data from? Where should the user send the Close message
to?) and of the implementation (each connection would need to consist
of two actors, one handling the reading, one the writing to remove
"the bottleneck" completely, these two actors would need to be
coordinated during closing the connection, etc). This extra complexity
would have to pull its weight. And it's not clear that an alternative
design would really be "faster". It may be true that you could get
lower latencies in the scenarios you envision by treating both
directions separately but e.g. it is not clear if throughput would be
higher as well.
Also the first purpose of Akka IO was Http which is a classic
request/response protocol which wouldn't benefit from such a design.
What kind of protocols do you have in mind?