by drej · 8y ago · 0 comments
$ go test -bench=.
goos: darwin
goarch: amd64
Benchmark_AllocWithMake-4 1000 1626664 ns/op
Benchmark_AllocWithAppend-4 1000 1574720 ns/op $ cat /proc/cpuinfo | grep 'model name' | uniq
model name: Intel(R) Core(TM) i7-5820K CPU @ 3.30GHz
$ go version
go version go1.9.1 windows/amd64
$ go test -bench . --benchtime 10s
goos: windows
goarch: amd64
Benchmark_AllocWithMake-12 20000 870349 ns/op
Benchmark_AllocWithAppend-12 30000 561120 ns/op