* This is an optimization of TcpStreamLogic to accumulating bytes in a buffer while waiting for
acknoledgment of pending write. This improves throughput for small messages (frames)
without sacrificing latency. While waiting for the ack the stage will eagerly pull
from upstream until the buffer limit is exceeded. Accumulated bytes are written
immediately when ack is received.
* Noticed 20x throughput improvement with Artery MaxThroughputSpec thanks to this buffer
when working on the Artery TCP implementation. The small message (100 bytes) benchmark
improved from 30k msg/s to 600k msg/s.
main work by @drewhk with contributions from @2m and @rkuhn
This work uncovered many well-hidden bugs in existing Stages, in
particular StatefulStage. These were hidden by the behavior of
OneBoundedInterpreter that normally behaves more orderly than it
guarantees in general, especially with respect to the timeliness of
delivery of upstream termination signals; the bugs were then that
internal state was not flushed when onComplete arrived “too early”.
* Gives Inlets and Outlets a `carbonCopy` method and switches to allocate them via `apply`
* Removes 4 Array allocations per FanIn and uses a bitmasked array instead
* Makes the FlattenStrategy.concat instance a singleton