samedi 4 juin 2016

What does B/op mean in go test -benchmem?

Title says it all, I ran go test -bench . -benchmem and here's the output:

testing: warning: no tests to run
PASS
BenchmarkPrintContat-8   3000000           435 ns/op         320 B/op          5 allocs/op
BenchmarkPrintJoin-8     5000000           240 ns/op         384 B/op          2 allocs/op
ok      $GOPATH/.../go_practice/strings 3.214s

On IRC the answer was

Probably Bytes per operation

But it could also refer (in my limited understanding) to *testing.B used in the benchmark

So what does B/op mean?

Note: If this is documented anywhere please share a reference, I might find other goodies in the process of learning Go

Aucun commentaire:

Enregistrer un commentaire