I could be wrong or low on caffeine but it looks to me like there is effective buffer recycling with readBuffer but not with writeBuffer at the moment? Am I reading that incorrectly or maybe it doesn't matter?
That is, it looks like with writeBuffer there is a decent amount of copying in Response.merge() and then wrap(). I get a sense we could avoid the byte[] result = new byte[size]; and look to recycle writeBuffer instead?
I could be wrong or low on caffeine but it looks to me like there is effective buffer recycling with
readBufferbut not withwriteBufferat the moment? Am I reading that incorrectly or maybe it doesn't matter?That is, it looks like with writeBuffer there is a decent amount of copying in
Response.merge()and thenwrap(). I get a sense we could avoid thebyte[] result = new byte[size];and look to recycle writeBuffer instead?