Provides concurrent thread-safe collections for highly concurrent scenarios in Java 17+.
-
BucketSyncMap: A high-performance implementation of
ConcurrentMap.- Fully compatible with the Java Collections Framework (
ConcurrentMap). - Delivers up to 2× higher update throughput than
ConcurrentHashMapunder heavy contention, while matching its performance for reads and other operations.
- Fully compatible with the Java Collections Framework (
-
ForwardedSyncMap: A performant implementation of
ConcurrentMap.- Fully compatible with the Java Collections Framework (
ConcurrentMap). - Delivers up to 2× higher update throughput than
ConcurrentHashMapunder heavy contention, while being a bit slower in reads and other operations.
- Fully compatible with the Java Collections Framework (
Sync is available at the Maven Central Repository.
Gradle
dependencies {
implementation("space.vectrix:sync-collections:1.0.0")
}Maven
<dependency>
<groupId>space.vectrix</groupId>
<artifactId>sync-collections</artifactId>
<version>1.0.0</version>
</dependency>The benchmarks below were recorded on a M4 Macbook Pro.
SyncMap draws inspiration from Go’s sync package — particularly its sync.Map and synchronization primitives — to deliver efficient, lock-free behavior in Java.