You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I created a simple benchmark file and I get ns/op in the femtosecond range.
package main
import (
"math/rand/v2""testing"
)
funcBenchmarkRandInt(b*testing.B) {
rand.Int()
}
What did you see happen?
$ go test -bench='.' -count=1
goos: darwin
goarch: arm64
pkg: benchmarkbug
cpu: Apple M3 Pro
BenchmarkRandInt-11 1000000000 0.0000003 ns/op
PASS
ok benchmarkbug 0.210s
What did you expect to see?
I expected not to see operations completed in sub femtosecond time.
Possible cause: It seems that go test believes that it ran 1000000000 tests while it only ran one and then probably divided the run time with 1000000000.
The text was updated successfully, but these errors were encountered:
Go version
go version go1.23.1 darwin/arm64
Output of
go env
in your module/workspace:What did you do?
I created a simple benchmark file and I get ns/op in the femtosecond range.
What did you see happen?
$ go test -bench='.' -count=1
goos: darwin
goarch: arm64
pkg: benchmarkbug
cpu: Apple M3 Pro
BenchmarkRandInt-11 1000000000 0.0000003 ns/op
PASS
ok benchmarkbug 0.210s
What did you expect to see?
I expected not to see operations completed in sub femtosecond time.
Possible cause: It seems that go test believes that it ran 1000000000 tests while it only ran one and then probably divided the run time with 1000000000.
The text was updated successfully, but these errors were encountered: