-
Notifications
You must be signed in to change notification settings - Fork 17.8k
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
syscall: Go 1.12 MacOS syscall/IO perf regression (solved: fsync root cause) #30497
Comments
30x slower is worse than I would have hoped, but some slowdown is expected. See the release notes, specifically https://golang.org/doc/go1.12#darwin. We now make all system calls through the C library on Darwin, because it is the only way to be forward compatible to future releases. |
Yeah I figured it might be related to #17490. Would it be possible to get this behaviour flagged on/off by any chance? I'd be willing to not have forward-compatible builds, i.e. for when running tests. Also, when I used pprof to debug this, I couldn't actually identify the cause of the slow down. Is this expected? For example, here's the blockprofile graph: And here's the cpuprofile graph: Both were computed by running |
It's not realistically possible to use a flag. The changes are extensive. We can't support both versions, especially since Apple has explicitly told us to stop using the old version. I don't really know the answers to your profiling questions. But when I look at your profile, one thing jumps out at me: the use of |
Makes sense regarding the flag. And ah interesting, thanks for pointing this out @ianlancetaylor. Good to know (and luckily our production workloads all run on Linux). I tested this hypothesis of yours by commenting out the fsync calls. When I did this, and ran with go 1.12 darwin/amd64, the tests complete in ~0.1s. Much closer to the go 1.11 speed of 0.08s!
|
OK, thanks, I don't think there is anything to do here. |
When I run the same test on a linux machine, I see it take ~0.27s:
This means that the macos fsync implementation is still 10x slower than linux's (!!). I guess since the |
Version: go version go1.12 darwin/amd64 (MacOS 10.13.6)
After upgrading from go 1.11.5 to go 1.12 I'm seeing a very large performance regression in https://github.com/etcd-io/bbolt tests (see etcd-io/bbolt#149). BoltDB is a memory-mapped BTree database used in projects such as etcd.
Filing an issue here since the only change that has happened is I have changed Go versions.
Steps to reproduce:
go test -run TestSimulate_1000op_1p
with Go 1.11.5go test -run TestSimulate_1000op_1p
with Go 1.12Observe that the the time to run (3) is about 30x slower than the time to run (2). On my machine step (3) takes ~0.09s and step (2) takes ~2.6s. I cannot reproduce this issue on a Linux machine.
The text was updated successfully, but these errors were encountered: