Created
May 28, 2019 08:20
-
-
Save qianbin/5476aae33752927618bc5718179fa253 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for { | |
t := time.Now().UnixNano() | |
for i := 0; i < 1000; i++ { | |
var key [2]byte | |
rand.Read(key[:]) | |
it := mainDB.NewIterator(*kv.NewRangeWithBytesPrefix(key[:])) | |
if it.Next() { | |
it.Value() | |
} | |
it.Release() | |
} | |
fmt.Println(time.Duration(time.Now().UnixNano() - t)) | |
select { | |
case <-exitSignal.Done(): | |
return nil | |
default: | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment