Closed withinboredom closed 2 weeks ago
This is probably a good idea 👍. Workers have their own request chan, so you should probably set the capacity there.
I imagine though that the goroutine would get blocked anyways when waiting for fc.done
, so this will probably only have a small impact on performance.
Yeah, the reason I didn't provide benchmarks is because it is barely detectable. It is probably more detectable with more cores (I only have 16 to test with).
Thanks @withinboredom
Currently, the request channel isn't buffered. This means that if two requests come in concurrently, one is blocked even if two workers are immediately available. Ideally, the buffer would be equal to the number of threads, thus if you had four workers, four requests can be added to the channel immediately, without blocking.