0.00429 ns/op seems suspiciously low. I suspect that there could be a 
problem with your benchmark. Could you post the code. 
( On this mailing list please just send code as plain text or as a link to 
the Go playground.) 

On Thursday, August 13, 2020 at 9:18:52 PM UTC-4 Patrick wrote:

> I'm new to go, and have being looking at escape analysis by benchmarking 
> some code that I created.
>
> What I see is the escape analysis shows that certain variables escape to 
> the heap.
>
> parameter path leaks to {heap} with derefs=2
>
>
> But the result of the benchmark test shows 0 allocations.
>
> 1000000000          0.00429 ns/op        0 B/op        0 allocs/op
>
>
> Does the 0 allocs/op mean that the compiler optimised the code and the 
> parameter path did not leak to the heap?  Also, since there are 0 
> allocs/ops does this mean I don't need to be concerned about leaking to the 
> heap?
>
> Allocation recording is turned on in the test
>
> Thanks
>
>
>
>
>

-- 
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/082e063f-e297-4eca-97bb-2c4f5f8a658an%40googlegroups.com.

Reply via email to