Hi Ian Davis, I read the issue before I post this thread. I think the old issue is quite different than here. Here the problem discusses sudden performance drop and unexpected regression, but the issue#5183 only did experiment on a very limited number of goroutines, and Dmitry's answer is fair in that case.
Best, Changkun On Tuesday, August 20, 2019 at 10:55:13 AM UTC+2, Ian Davis wrote: > > > On Tue, 20 Aug 2019, at 9:33 AM, changkun wrote: > > Hi Robert, > > Thanks for your explanation. But how could I "logged the number of > operations done per Go routine", which particular debug settings you > referring to? > It is reasonable that sync.Mutex rely on runtime scheduler but channels do > not. However, it is unclear why a significant performance drop appears. Is > it possible to determine when the performance will appear? > > > This comment by Dmitry Vyukov on a very old issue might help (I have no > idea if it is still valid after 6 years though) > > If you are interested why chan does not have the same issue, runtime handles > chan's in a > special way (active/passive spinning + thread parking instead of goroutine > parking), > because it knowns that the critical section is bounded and small. For > sync.Mutex it does > not have any knowledge as to critical section size. > > > See https://github.com/golang/go/issues/5183 > > > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/e90669c4-42de-4f33-9327-41d35cf26077%40googlegroups.com.