New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
time: Now is somehow being very slow on Ubuntu 16.04 #33448
Comments
Thank you for this report @wangcheng711 and welcome to the Go project! That's quite odd, could you please perhaps share as much information about your machine?
I shall kindly page some experts to take a look too @ianlancetaylor @aclements @randall77 |
Can you show us the program that you are profiling? |
|
Your program calls Since When writing a micro-benchmark like this, always look at the generated code to make sure you are measuring that you think you are measuring. Micro-benchmarks are hard to write correctly. |
i have two pc the same binary (build on a), the program output is: why a run so slow? |
it's quite odd, pc b is poor, why the total elapse time is small.
b:
|
I don't think it's going to be very interesting to investigate the behavior of a Go program that just calls |
@ianlancetaylor thanks for your suggestion! |
@wangcheng711 I shall close this as there isn't much actionable here. However, when you get some findings, please feel free to report back and also please don't hesitate to report other issues. |
@ianlancetaylor @odeke-em today, ubuntu 16.04 has update kernel to 4.15.0-58-generic,before is 4.15.0-55-generic
so, there may be some trouble with kernel 4.15.0-55? |
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?
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?
The text was updated successfully, but these errors were encountered: