Re: [go-nuts] Interface() method of reflect.Value sometimes allocates, sometimes not

2023-06-26 Thread Ian Lance Taylor
On Mon, Jun 26, 2023 at 8:28 AM christoph...@gmail.com wrote: > > I'm implementing a value encoder similar to gob. While bench-marking my code > against gob, I noticed some unexpected memory allocations with a particular > type of data. > > See this minimal code example in the go playground > h

[go-nuts] Interface() method of reflect.Value sometimes allocates, sometimes not

2023-06-26 Thread christoph...@gmail.com
I'm implementing a value encoder similar to gob. While bench-marking my code against gob, I noticed some unexpected memory allocations with a particular type of data. See this minimal code example in the go playground https://go.dev/play/p/4rm-kCtD274 There is a simple function foo() receiving