Did they really get such a performance boost (x6) over standard coroutine implementation, or was it because of the single-threaded implementation?
v
Vsevolod Tolstopyatov [JB]
05/28/2018, 3:45 PM
I’ve carefully analyzed these benchmarks.
The first improvement is achieved by narrowing responsibility scope:
the channel becomes single-producer/single consumer,
close
and
select
support is dropped. In general, it’s a good idea to write very specialized solutions for high-performance code, but such solutions are rarely useful outside of specific use-case.
x6 boost is achieved only because solution became single-threaded. Note: not SP/SC, but single-threaded, producer and consumer should be executed on the same thread. No