
SwissMap), SIMD-probing (SwissSimdMap), predictable probe lengths (Robin Hood), and minimal per-entry overhead.SwissSimdMap uses the incubating Vector API for SIMD acceleration.HashMap; performance depends on workload.docs/SwissSimdMap.md for details.SwissMap using per-shard StampedLock (null keys not supported).Vector API is still incubating, and profiling on my setup showed the SIMD path taking longer than expected, so the default SwissMap favors a SWAR probe. Numbers can differ significantly by hardware/JVM version; please run your own benchmarks if you plan to use SwissSimdMap.
import io.github.bluuewhale.hashsmith.SwissMap; // SWAR
import io.github.bluuewhale.hashsmith.ConcurrentSwissMap;
import io.github.bluuewhale.hashsmith.SwissSet;
// SwissMap (SWAR)
var swiss = new SwissMap<String, Integer>();
swiss.put("a", 1);
swiss.get("a"); // 1
// ConcurrentSwissMap (sharded, thread-safe)
var concurrentSwiss = new ConcurrentSwissMap<String, Integer>();
concurrentSwiss.put("a", 1);
concurrentSwiss.get("a"); // 1
// SwissSet
var swissSet = new SwissSet<String>();
swissSet.add("k");
swissSet.add(null); // nulls allowed
swissSet.contains("k"); // true
dependencies {
implementation("io.github.bluuewhale:hashsmith:0.1.8")
}
dependencies {
implementation 'io.github.bluuewhale:hashsmith:0.1.8'
}
<dependency>
<groupId>io.github.bluuewhale</groupId>
<artifactId>hashsmith</artifactId>
<version>0.1.8</version>
</dependency>
SwissSimdMap needs jdk.incubator.vector)--add-modules jdk.incubator.vector is already configured for build, test, and JMH tasks that exercise SwissSimdMap../gradlew build # full build
./gradlew test # JUnit 5 tests
HashMap vs SwissSimdMap vs SwissMap vs fastutil Object2ObjectOpenHashMap vs Eclipse Collections UnifiedMap) and sets (HashSet vs SwissSet vs fastutil ObjectOpenHashSet vs Eclipse Collections UnifiedSet).String keys (HashSet, SwissSet, ObjectOpenHashSet, UnifiedSet). Primitive-specialized collections (e.g., fastutil primitive sets) are excluded because their memory profile is driven by primitive storage, whereas these tests target general reference workloads.SwissMap/SwissSimdMap use open addressing to cut space; default load factor 0.875, up to 53.3% retained-heap reduction in payload-light cases vs HashMap.SwissSet (SwissHashSet) mirrors the SwissTable layout with SIMD control-byte probing and reuses tombstones to stay denser than HashSet across tested payloads, showing up to ~62% retained-heap reduction in lighter payload cases.| Map | Set |
|---|---|
![]() |
![]() |
AverageTime mode, 3 forks.| put hit | put miss |
|---|---|
![]() |
![]() |
| get hit | get miss |
|---|---|
![]() |
![]() |
1) Open an issue for bugs/ideas
2) Work on a feature branch and open a PR
3) Keep tests/JMH green before submitting
LICENSE for details.$ claude mcp add hash-smith \
-- python -m otcore.mcp_server <graph>