[go-nuts] Re: odd benchmark results for time.Now() call inside vs outside mutex

2020-02-24 Thread Jake Montgomery
FWIW, I also don't see any appreciable difference: goos: windows goarch: amd64 BenchmarkStateSet1-4 1368303 872 ns/op BenchmarkStateSet2-4 1379320 887 ns/op BenchmarkStateSet3-4 1343781 865 ns/op PASS ok command-line-arguments 7.446s On

[go-nuts] Re: odd benchmark results for time.Now() call inside vs outside mutex

2020-02-24 Thread Jim Robinson
That's interesting! My numbers earlier were from an AMD chip (2990WX) on Linux 5.3.11. On an older Intel chip (i7-4960HQ) on macOS 10.15.3 I still see small a difference but it's much smaller. $ go test -bench . goos: darwin goarch: amd64 BenchmarkStateSet1-82737468 441 ns/op

[go-nuts] Re: odd benchmark results for time.Now() call inside vs outside mutex

2020-02-24 Thread Sean Liao
maybe it's just your system? master ยป gotip test -bench . goos: linux goarch: amd64 pkg: testrepo-75 BenchmarkStateSet1-44173546 273 ns/op BenchmarkStateSet2-44547119 261 ns/op BenchmarkStateSet3-44556757 263 ns/op PASS ok testrepo-75 4.899s On Monday, February 2