Skip to content

In-memory HashMap primitives for Typhon - #176

Merged
nockawa merged 1 commit into
mainfrom
feature/in-memory-hashmap
Mar 23, 2026
Merged

nockawa merged 1 commit into
mainfrom
feature/in-memory-hashmap

Conversation

@nockawa

@nockawa nockawa commented Mar 23, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • InMemoryHashMap / InMemoryHashMapKV: Open-addressing hash set/map with linear probing, flat entry array — no chains, no pointer indirection
  • ConcurrentInMemoryHashMap / ConcurrentInMemoryHashMapKV: Thread-safe variants using stripe-based locking for concurrent read/write access
  • HashUtils: Shared hashing utilities (Fibonacci mixing, power-of-two sizing)
  • Comprehensive test suites (2,376 lines) and benchmarks (918 lines) including profiling workloads

Design

  • Single flat array layout for cache-friendly access patterns
  • Robin Hood-style linear probing with tombstone management
  • Automatic resize at configurable load factor threshold
  • Concurrent variants use fine-grained stripe locking (not global locks)
  • Zero allocations on lookups — all operations work on the backing array directly

Test plan

  • Unit tests for both set and key-value variants
  • Unit tests for concurrent variants (multi-threaded stress tests)
  • Benchmark suite for throughput profiling
  • Profile workload for dotTrace analysis

🤖 Generated with Claude Code

@nockawa
nockawa merged commit f92b273 into main Mar 23, 2026
5 checks passed
@nockawa
nockawa deleted the feature/in-memory-hashmap branch March 23, 2026 06:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant