]> Cypherpunks repositories - gostls13.git/commit
runtime: do not allocate on every time.Sleep
authorRuss Cox <rsc@golang.org>
Fri, 17 Feb 2017 15:17:42 +0000 (10:17 -0500)
committerRuss Cox <rsc@golang.org>
Fri, 24 Feb 2017 15:34:01 +0000 (15:34 +0000)
commita1261b8b0a38814df453defb2fc2cae3ba0c956a
treea40724e7525ff029b75ed62e834da23e551f85e2
parenta1ea91219faa7c35098ffbb958582897fcd33123
runtime: do not allocate on every time.Sleep

It's common for some goroutines to loop calling time.Sleep.
Allocate once per goroutine, not every time.
This comes up in runtime/pprof's background reader.

Change-Id: I89d17dc7379dca266d2c9cd3aefc2382f5bdbade
Reviewed-on: https://go-review.googlesource.com/37162
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
src/runtime/proc.go
src/runtime/runtime2.go
src/runtime/time.go