Richard Crowley’s blog

Go acknowledgement test

I have been writing a lot of Go lately at Betable and the channels of channels pattern comes up so often that I broken down and benchmarked it.  I’m publishig this more widely at the insistence of Paul Hammond who would agree that this is yet another of the many and persistent reminders that Rob Pike is smarter than I am.

In summary, it is faster to allocate a one-time-use channel for a goroutine to acknowledge a request than to use a sync.Mutex.