Skip to content

Optimize Subscribe()/Dispatch()

Mikhail Mazurskiy requested to merge ash2k/optimize-subscribe into master

Screenshot_2024-06-01_at_3.02.23_PM

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.

Merge request reports