Sorry for creating confusion, my reading mistake.
I read the inner-loop as:
if err := bdb.Get(key, ); err == nil && val.Value() != nil {
totalFound++
} else if err != nil {
totalErrored++
} else {
totalNotFound++
}
Which it obviously is not... :/
This day doesn't seem promising after this
Egon,
Obviously I ran the race detector. No races were detected. Therefore, since
it wasn't germane, I omitted it from the posted results.
Here's my results.
$ go test -run=! -bench=. -v -cpu=4 -race total_test.go
goos: linux
goarch: amd64
BenchmarkTotal/Count-4 5000
Note, you also have a race in your code.
Use `-race` to detect.
+ Egon
On Thursday, 10 August 2017 06:43:34 UTC+3, d...@dgraph.io wrote:
>
> Hi
>
> I am trying to benchmark a key-value store written in Go. I have the code
> as shown below. There are a few lines that are specific to the store
Package testing
https://golang.org/pkg/testing/
Benchmarks
The benchmark function must run the target code b.N times. During benchmark
execution, b.N is adjusted until the benchmark function lasts long enough
to be timed reliably.
The first thing to do is to reduce the program to the simplest