runtime: sema: many many goroutines queueing up on many many distinct addresses -> slow #38420
Labels
compiler/runtime
Issues related to the Go compiler and/or runtime.
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Performance
Milestone
Hello up there. libcsp claims to be 10x faster on a benchmark involving
sync.WaitGroup
for a divide-and-conqueror summation program. I've analyzed the profile and most of the time is being spent inruntime.(*semaRoot).dequeue
andruntime.(*semaRoot).queue
triggered by calls tosync.WaitGroup
.Done
and.Wait
. The benchmark uses many (~ Ngoroutines) different WaitGroups and semaphores simultaneously.Go commit 45c6f59e1fd9 says
It seems the above particular scenario is being hit in this benchmark.
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Ran benchmarks in libcsp.
What did you expect to see?
Libcsp and Go versions comparable in terms of speed.
What did you see instead?
Go version 10x slower.
The text was updated successfully, but these errors were encountered: