Use ConcurrentHashMap to improve performance (#2226)

* modified hashset collections for small performance gains

* reverted load factor modification since no noticeable performance gain was seen

---------

Co-authored-by: aseef <contact@aseef.dev>
This commit is contained in:
Aseeef 2023-03-12 14:05:19 -04:00 committed by GitHub
parent 365bb66d2a
commit 4f0fe72add
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -101,7 +101,7 @@ public class NettyChannelInjector implements Injector {
// packet marking
private final Map<Object, NetworkMarker> savedMarkers = new WeakHashMap<>(16, 0.9f);
private final Set<Object> skippedPackets = Collections.synchronizedSet(new HashSet<>());
private final Set<Object> skippedPackets = ConcurrentHashMap.newKeySet();
protected final ThreadLocal<Boolean> processedPackets = ThreadLocal.withInitial(() -> Boolean.FALSE);
// status of this injector