Has anyone benchmarked kotlin's SharedFlowImpl?

I'm seeing thread contention on a SharedFlow with several collectors, and a quick peek shows that that emitting & taking values all uses a single central lock per instance (.. and it's `this` which is an antipattern)

https://github.com/Kotlin/kotlinx.coroutines/blob/master/kotlinx-coroutines-core/common/src/flow/SharedFlow.kt#L639-L655
Post image

Comments