badger: Why on linux slower than on win10?

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

$ go version
1.13

What version of Badger are you using?

v1.6.0

Does this issue reproduce with the latest master?

yes

What are the hardware specifications of the machine (RAM, OS, Disk)?

win10 : i5-7500, 16G RAM, SSD linux : Intel® Xeon® CPU E5-2637 v3 @ 3.50GHz, 64G RAM, SSD

What did you do?

db, err := badger.Open(badger.DefaultOptions("badger"))
if err != nil {
	panic(err)
}
defer db.Close()
for i := 0; i < 10_0000; i++ {
	bs := make([]byte, 8)
	binary.BigEndian.PutUint64(bs, uint64(time.Now().UnixNano())+rand.Uint64())
	err := db.Update(func(txn *badger.Txn) error {
		return txn.Set(bs, bs)
	})
	if err != nil {
		panic(err)
	}
}

What did you expect to see?

win10 is is similar to linux

What did you see instead?

It spends 3s on win10 but 30s on linux. The linux is a machine of production env, can you try on your win10 and linux? Maybe my linux has some problem?

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 15 (3 by maintainers)

Most upvoted comments

@bonedaddy - As far as I understand it the bug here isn’t that Linux is slow, it’s that Windows is fast only because Go doesn’t actually open the files as sync and so it’s using async everywhere.