Optimize Subscribe()/Dispatch()
We can see that Dispatch()
is spending quite a bit of time in select
(8% of all CPU time!). I think this is because it's triggering listening goroutines one by one via an unbuffered channel. If we add a small buffer, it'll be able to kick all the listeners off concurrently.
This is with v17.1.0-rc7 and 50% weight in Google Cloud Profiler.