Closed dulithag closed 2 years ago
result collector iterates over all channels and pulls results from channel making more room for next result. When running queries with large payload I observed a slow down in a single thread's query causes latency to propagate to other threads since they are waiting to push result to already filled channel.
This implementation maintains order of results and is a simple fix. A better implementation would be to use a single channel owned by result collector. All go routines will push results to this single channel. In such an implementation order cannot be guaranteed.
…ne from slowing down all go routines