mirror of
https://github.com/tiennm99/zfoo.git
synced 2026-10-12 14:15:22 +00:00
doc[protocol]: readRetainedSlice和byte[]数组相比,readRetainedSlice减少了垃圾回收
This commit is contained in:
1 parent
03c742feb8
commit
e577e8e71e
1 file changed
+1
@@ -62,6 +62,7 @@ public class TcpCodecHandler extends ByteToMessageCodec<EncodedPacketInfo> {
|
||||
|
||||
ByteBuf tmpByteBuf = null;
|
||||
try {
|
||||
// readRetainedSlice和byte[]数组相比,readRetainedSlice减少了垃圾回收
|
||||
tmpByteBuf = in.readRetainedSlice(length);
|
||||
DecodedPacketInfo packetInfo = NetContext.getPacketService().read(tmpByteBuf);
|
||||
out.add(packetInfo);
|
||||
|
||||
Reference in new issue
Block a user