For the following code


https://go.dev/play/p/ynn7ihKXrp0?v=gotip


I got the benchmark


BenchmarkBelow3-16 9523 147772 ns/op 17 B/op 2 allocs/op

BenchmarkBelow3direct-16 10000 107335 ns/op 0 B/op 0 allocs/op


range-over-func has two more alloc than direct-call-func.


Why?

-- 
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/c203eb4f-3efc-4fff-a511-0f2210d78e15n%40googlegroups.com.

Reply via email to