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)
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
>
> .