]> Cypherpunks repositories - gostls13.git/commit
runtime: benchmark for ping-pong in the presence of a CPU hog
authorAustin Clements <austin@google.com>
Wed, 22 Apr 2015 20:38:04 +0000 (16:38 -0400)
committerAustin Clements <austin@google.com>
Fri, 24 Apr 2015 15:12:47 +0000 (15:12 +0000)
commitda0e37fa8d284e92972877c4be3d031ecf1c8334
tree8e2029adf04a82e0bb0cad04d6152f22ec623758
parente5e52f4f2c6f67e41b97fd539c1963f85536c985
runtime: benchmark for ping-pong in the presence of a CPU hog

This benchmark demonstrates a current problem with the scheduler where
a set of frequently communicating goroutines get very little CPU time
in the presence of another goroutine that hogs that CPU, even if one
of those communicating goroutines is always runnable.

Currently it takes about 0.5 milliseconds to switch between
ping-ponging goroutines in the presence of a CPU hog:

BenchmarkPingPongHog     2000     684287 ns/op

Change-Id: I278848c84f778de32344921ae8a4a8056e4898b0
Reviewed-on: https://go-review.googlesource.com/9288
Reviewed-by: Rick Hudson <rlh@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
src/runtime/proc_test.go