Perhaps it will have a small benefit. However, according to the benchmark,
the performance is slightly better in the case where there is 1 alloc/op,
Normally people avoid the heap allocation for better performance and there
is no evidence of that here.
On Fri, Aug 26, 2022 at 3:32 AM Lee Chou wr
Thanks for taking the time for the clue. It seems that this is an open
issue.
Actually, It work for this case. aovid the alloc will have more benefit for
gc.
在2022年8月26日星期五 UTC+8 02:49:08 写道:
> Actually, looking more closely at your benchmark numbers, the trick does
> not work in your case.
Actually, looking more closely at your benchmark numbers, the trick does
not work in your case. Which makes sense to me, I don't see why it would
work.
On Wednesday, August 24, 2022 at 2:59:34 AM UTC-4 mozart...@gmail.com wrote:
> I was try using net.Buffers for writev. But I meet a unexptecte
That trick was copied from here:
https://cs.opensource.google/go/go/+/refs/tags/go1.19:src/strings/builder.go;l=26
See https://github.com/golang/go/issues/23382 and
https://github.com/golang/go/issues/7921
I don't know why the trick works in your case. It appears to be safe.
On Wednesday, Aug
That trick was copied from
here:
https://cs.opensource.google/go/go/+/refs/tags/go1.19:src/strings/builder.go;l=26
See https://github.com/golang/go/issues/23382
and https://github.com/golang/go/issues/23382
and https://github.com/golang/go/issues/7921
I don't know why the trick works in your