diff --git a/ants.go b/ants.go index d00d190..2b4cde4 100644 --- a/ants.go +++ b/ants.go @@ -76,16 +76,15 @@ var ( // to get the best performance. Inspired by fasthttp at // https://github.com/valyala/fasthttp/blob/master/workerpool.go#L139 workerChanCap = func() int { - // Use blocking workerChan if GOMAXPROCS=1. - // This immediately switches Serve to WorkerFunc, which results - // in higher performance (under go1.5 at least). + // Use blocking channel if GOMAXPROCS=1. + // This switches context from sender to receiver immediately, + // which results in higher performance (under go1.5 at least). if runtime.GOMAXPROCS(0) == 1 { return 0 } // Use non-blocking workerChan if GOMAXPROCS>1, - // since otherwise the Serve caller (Acceptor) may lag accepting - // new connections if WorkerFunc is CPU-bound. + // since otherwise the sender might be dragged down if the receiver is CPU-bound. return 1 }()