Jetty 12.0.x h2c perf improvement: implement equals/hashcode in Stream (#9077)

implement equals/hashcode in H2Stream

Signed-off-by: Ludovic Orban <lorban@bitronix.be>
This commit is contained in:
Ludovic Orban 2023-01-09 10:37:20 +01:00 committed by GitHub
parent 1dc175efac
commit f14c0a5002
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 2 deletions

View File

@ -28,7 +28,6 @@ import java.util.Map;
import java.util.Queue;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.TimeoutException;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicLong;
@ -84,7 +83,7 @@ public abstract class HTTP2Session extends ContainerLifeCycle implements Session
{
private static final Logger LOG = LoggerFactory.getLogger(HTTP2Session.class);
private final ConcurrentMap<Integer, HTTP2Stream> streams = new ConcurrentHashMap<>();
private final Map<Integer, HTTP2Stream> streams = new ConcurrentHashMap<>();
private final AtomicLong streamsOpened = new AtomicLong();
private final AtomicLong streamsClosed = new AtomicLong();
private final StreamsState streamsState = new StreamsState();

View File

@ -99,6 +99,18 @@ public class HTTP2Stream implements Stream, Attachable, Closeable, Callback, Dum
return streamId;
}
@Override
public boolean equals(Object o)
{
return this == o;
}
@Override
public int hashCode()
{
return streamId;
}
@Override
public Object getAttachment()
{