• Austin Clements's avatar
    runtime: use only dedicated mark workers at reasonable GOMAXPROCS · 315c28b7
    Austin Clements authored
    When GOMAXPROCS is not small, fractional workers don't add much to
    throughput, but they do add to the latency of individual goroutines.
    In this case, it makes sense to just use dedicated workers, even if we
    can't exactly hit the 25% CPU goal with dedicated workers.
    
    This implements this logic by computing the number of dedicated mark
    workers that will us closest to the 25% target. We only fall back to
    fractional workers if that would be more than 30% off of the target
    (less than 17.5% or more than 32.5%, which in practice happens for
    GOMAXPROCS <= 3 and GOMAXPROCS == 6).
    
    Updates #21698.
    
    Change-Id: I484063adeeaa1190200e4ef210193a20e635d552
    Reviewed-on: https://go-review.googlesource.com/68571Reviewed-by: default avatarRick Hudson <rlh@golang.org>
    315c28b7
mgc.go 72.2 KB