Use ArrayDeque instead of LinkedList (#9046)

Motivation:
Prefer ArrayDeque to LinkedList because latter will produce more GC.

Modification:
- Replace LinkedList with ArrayDeque

Result:
Less GC
This commit is contained in:
BELUGABEHR 2019-04-15 09:13:22 -04:00 committed by Norman Maurer
parent dde3f561bc
commit 09faa72296

View File

@ -21,7 +21,7 @@ import io.netty.handler.codec.http.HttpMessage;
import io.netty.handler.codec.spdy.SpdyHttpHeaders.Names;
import io.netty.util.ReferenceCountUtil;
import java.util.LinkedList;
import java.util.ArrayDeque;
import java.util.List;
import java.util.Queue;
@ -33,7 +33,7 @@ import java.util.Queue;
public class SpdyHttpResponseStreamIdHandler extends
MessageToMessageCodec<Object, HttpMessage> {
private static final Integer NO_ID = -1;
private final Queue<Integer> ids = new LinkedList<Integer>();
private final Queue<Integer> ids = new ArrayDeque<Integer>();
@Override
public boolean acceptInboundMessage(Object msg) throws Exception {