FWIW I do not get the same result: goos: windows goarch: amd64 cpu: AMD Phenom(tm) II X4 830 Processor BenchmarkFilter3-4 599912 1902 ns/op 0 B/op 0 allocs/op BenchmarkFilter4-4 569143 2118 ns/op 0 B/op 0 allocs/op PASS
On Monday, June 7, 2021 at 10:57:19 AM UTC-4 tapi...@gmail.com wrote: > > The code: https://play.golang.org/p/DxUj6kBqf8k > > The Filter4 function has one more assignment statement than Filter3. > But the benchmark result shows Filter4 is faster than Filter3. > > The result: > > cpu: Intel(R) Core(TM) i5-4210U CPU @ 1.70GHz > BenchmarkFilter3-4 3575656 980.2 ns/op 0 > B/op 0 allocs/op > BenchmarkFilter4-4 3956533 916.8 ns/op 0 > B/op 0 allocs/op > > > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/18a41a4e-a648-4777-a906-e024a8ee4838n%40googlegroups.com.