% go test -bench=. ./...
goos: linux
goarch: amd64
pkg: test/cmd/test13
cpu: AMD Ryzen 7 PRO 4750U with Radeon Graphics
BenchmarkFStruct-16 1000000000 0.4255 ns/op
BenchmarkFStructNoinline-16 433233346 2.499 ns/op
BenchmarkFInterface-16 456309434 2.496 ns/op
BenchmarkFInterfaceNoinline-16 246691125 4.415 ns/op
BenchmarkFGeneric-16 259775330 4.417 ns/op
BenchmarkFGenericNoinline-16 272950497 4.005 ns/op
PASS
ok test/cmd/test13 7.996s
go test -bench=. ./... 8.56s user 0.64s system 110% cpu 8.313 total
Best result
% go test -bench=. ./...
goos: linux
goarch: amd64
pkg: test/cmd/test13
cpu: AMD Ryzen 7 PRO 4750U with Radeon Graphics
BenchmarkFStruct-16 1000000000 0.4528 ns/op
BenchmarkFStructNoinline-16 457676677 2.491 ns/op
BenchmarkFInterface-16 452713634 2.418 ns/op
BenchmarkFInterfaceNoinline-16 257723593 4.632 ns/op
BenchmarkFGeneric-16 252807128 4.583 ns/op
BenchmarkFGenericNoinline-16 466000674 2.533 ns/op
PASS
ok test/cmd/test13 10.075s
go test -bench=. ./... 10.56s user 0.54s system 107% cpu 10.332 total
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