dns icon indicating copy to clipboard operation
dns copied to clipboard

ReadMsgHeader use bytes pool

Open IIvyPy opened this issue 2 years ago • 1 comments

I find the makeslice of ReadMsgHeader will cost much GC time. So I suggest to use bytes pool to avoid the GC cost.

IIvyPy avatar Jun 28 '22 02:06 IIvyPy

your commit message also don't explain anything about this change, it's just a one-liner

So it's on the client you want to use a buffer just like we do on the server side? Any data available (that should be in the ocmmit msg) on why and how this came about??

miekg avatar Jul 07 '22 10:07 miekg

I'm sympathetic to the performance concerns here, but this isn't quite the way to go about it. We'd need a pool on the Client struct itself. But considering there's been no movement here in almost a year, I'm going to go ahead and close this PR. Feel free to re-open and address the issues above.

tmthrgd avatar Apr 18 '23 03:04 tmthrgd