Skip to content

time: Now is somehow being very slow on Ubuntu 16.04 #33448

@wangcheng711

Description

@wangcheng711

What version of Go are you using (go version)?

go version go1.12.7 linux/amd64

Does this issue reproduce with the latest release?

yes

What operating system and processor architecture are you using (go env)?

go env Output
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/golang/.cache/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/golang/gocode:/home/golang/work"
GOPROXY=""
GORACE=""
GOROOT="/home/golang/go"
GOTMPDIR=""
GOTOOLDIR="/home/golang/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build008341203=/tmp/go-build -gno-record-gcc-switches"

What did you do?

Time: Aug 3, 2019 at 5:00pm (CST)
Duration: 4.91s, Total samples = 5s (101.92%)
Entering interactive mode (type "help" for commands, "o" for options)
(pprof) list time.now
Total: 5s
ROUTINE ======================== time.now in /home/golang/go/src/runtime/timestub.go
2.69s 2.70s (flat, cum) 54.00% of Total
. . 11:
. . 12:import _ "unsafe" // for go:linkname
. . 13:
. . 14://go:linkname time_now time.now
. . 15:func time_now() (sec int64, nsec int32, mono int64) {
1.42s 1.42s 16: sec, nsec = walltime()
1.27s 1.28s 17: return sec, nsec, nanotime()
. . 18:}
(pprof) top -cum
Showing nodes accounting for 4.43s, 88.60% of 5s total
Dropped 25 nodes (cum <= 0.03s)
Showing top 10 nodes out of 31
flat flat% sum% cum cum%
2.69s 53.80% 53.80% 2.70s 54.00% time.now
1.67s 33.40% 87.20% 1.71s 34.20% time.Since
0.01s 0.2% 87.40% 0.35s 7.00% main.main
0 0% 87.40% 0.35s 7.00% runtime.main
0.02s 0.4% 87.80% 0.29s 5.80% runtime.makeslice
0.03s 0.6% 88.40% 0.27s 5.40% runtime.mallocgc
0 0% 88.40% 0.19s 3.80% runtime.(*mcache).nextFree
0 0% 88.40% 0.19s 3.80% runtime.(*mcache).refill
0.01s 0.2% 88.60% 0.19s 3.80% runtime.(*mcentral).cacheSpan
0 0% 88.60% 0.18s 3.60% runtime.(*mcentral).grow
(pprof)

What did you expect to see?

What did you see instead?

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.WaitingForInfoIssue is not actionable because of missing required information, which needs to be provided.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions