3 ms·
Not sure it holds any more, I got these results $ go test -bench=. goos: darwin goarch: amd64 Benchmark_AllocWithMake-4 1000 1626664 ns/op
by drej 9y ago
Not sure it holds any more, I got these results
$ go test -bench=.
goos: darwin
goarch: amd64
Benchmark_AllocWithMake-4 1000 1626664 ns/op
Benchmark_AllocWithAppend-4 1000 1574720 ns/op
- seppoastian 9y agoI got nearly the same ratio as the github example. (CPU is overclock to ~4 GHz) $ 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
- tapirl 9y agoPlease note that the Benchmark_AllocWithMake function even doesn't call "copy(y, x)".