Skip to content
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

Go 1.12 darwin performance regression #149

Closed
jared2501 opened this issue Feb 28, 2019 · 6 comments
Closed

Go 1.12 darwin performance regression #149

jared2501 opened this issue Feb 28, 2019 · 6 comments

Comments

@jared2501
Copy link

I'm using bbolt in a project that I've just upgraded to go 1.12 (from go 1.11.5). I've seen a chaos integration test go from 1 second in go 1.11.5 to 21 seconds in go 1.12.

I'm going to investigate a little further to try and identify what exactly is taking longer, creating this issue in case anyone else notices a similar problem when upgrading.

@jared2501 jared2501 changed the title Go 1.12 performance regression Go 1.12 darwin performance regression Feb 28, 2019
@jared2501
Copy link
Author

I've confirmed that this is isolated to boltdb's Update API, and only reproducible on darwin.

@jared2501
Copy link
Author

Is it possible that golang/go#17490 could be the cause of this?

@jared2501
Copy link
Author

jared2501 commented Mar 1, 2019

Here's an example using the bbolt simulation tests:

✓ jared@Jareds-MacBook-Pro:~/go/src/go.etcd.io/bbolt | master $ go version
go version go1.11.5 darwin/amd64
✓ jared@Jareds-MacBook-Pro:~/go/src/go.etcd.io/bbolt | master $ go test -run TestSimulate_1000op_1p
seed: 95000
quick settings: count=5, items=1000, ksize=1024, vsize=1024
PASS
ok  	go.etcd.io/bbolt	0.086s

Then after I install go 1.12:

✓ jared@Jareds-MacBook-Pro:~/go/src/go.etcd.io/bbolt | master $ go version
go version go1.12 darwin/amd64
✓ jared@Jareds-MacBook-Pro:~/go/src/go.etcd.io/bbolt | master $ go test -run TestSimulate_1000op_1p
seed: 45000
quick settings: count=5, items=1000, ksize=1024, vsize=1024
PASS
ok  	go.etcd.io/bbolt	2.511s

Run on macos 10.13.6.

@jared2501
Copy link
Author

jared2501 commented Mar 1, 2019

As diagnosed on golang/go#30497, it appears that:

  • Go's fsync API prior to go 1.12 actually behaved incorrectly.
  • In Go 1.12, it was fixed to perform a F_FULLFSYNC, which has resulted in the large performance regression.

It looks like there's likely not much that can be done here...

@WIZARD-CXY
Copy link
Contributor

hmm

@xiang90 xiang90 closed this as completed Mar 12, 2019
@xiang90
Copy link
Contributor

xiang90 commented Mar 12, 2019

i think it is the right thing for go to do. we used to wrap fsync for the same reason for osx in etcd.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants