Re: [go-nuts] Is there a possible to add sync.Pool to io.copyBuffer

2020-05-21 Thread qingyunha
Thank you! I change the code as your suggestion, it reduce 10% cpu usage. 在 2020年5月21日星期四 UTC+8下午1:04:34,Ian Lance Taylor写道: > > On Wed, May 20, 2020 at 9:26 PM > wrote: > > > > Hi all: > > I write a simpile HTTP proxy,and find the most alloctions appear in > io.copyBuffer > > > >>> (pprof)

[go-nuts] Is there a possible to add sync.Pool to io.copyBuffer

2020-05-20 Thread qingyunha
Hi all: I write a simpile HTTP proxy,and find the most alloctions appear in io.copyBuffer (pprof) list io.copyBuffer > > Total: 2.80TB > > ROUTINE io.copyBuffer in >> /usr/local/go/src/io/io.go > > 1.03TB 2.47TB (flat, cum) 88.16% of Total > > .