Re: [go-nuts] Re: Bytconv where art thou

2017-09-26 Thread Peter Waller
On 25 September 2017 at 17:43, Amnon Baron Cohen wrote: > https://github.com/golang/go/issues/2632 > Nice link, fun to see that all this discussion has happened before (and no doubt, will happen again!). Reading that thread and related threads, I get the impression that there is not an open iss

Re: [go-nuts] Re: Bytconv where art thou

2017-09-24 Thread Peter Waller
On 15 September 2017 at 11:54, roger peppe wrote: > I suspect that this kind of performance issue may be fixed by better > compiler optimisation in the future (I think should be possible for > the compiler to notice that the string doesn't escape and pass a > pointer to the byte slice as the stri

Re: [go-nuts] Re: Bytconv where art thou

2017-09-15 Thread roger peppe
I suspect that this kind of performance issue may be fixed by better compiler optimisation in the future (I think should be possible for the compiler to notice that the string doesn't escape and pass a pointer to the byte slice as the string argument). On 15 September 2017 at 10:36, Peter Waller

Re: [go-nuts] Re: Bytconv where art thou

2017-09-15 Thread Peter Waller
Because of the immutability of the string, constructing a string on a byte slice requires allocating and copying the bytes. Once you've got the string, it's "free" to pass around. If you've already got strings, everything is fine. But if you're reading the data from IO, you're probably starting wi