Immutable Sequential Maps – Keeping order while hashed
summary
Scala 2.13 adds a SeekMap trait with mutable and immutable variants; several implementations are benchmarked using sbt-jmh and JMH plus the JMH visualizer. The default vector map stores a hashmap plus an index vector and performs well generally but inserts tombstones on removals, causing very slow consecutive deletes; a tree-based SeekMap trades about 50% more memory for much faster removals and in one concat benchmark shows ~370k vs ~900k ns/op for vector map. ListMap is cheapest for prepend-heavy patterns but degrades badly for indexed access.
AI-written summary · about
chapters (11)
- 0:00Start
- 1:55What is a sequential map?
- 4:22Challenges
- 5:27Essential Operations
- 7:13LinkedHashMap
- 8:35Immutable
- 9:04Combination Strategy
- 10:18Definitions
- 16:03VectorMap - Removal
- 37:25Conclusions
- 39:54Becoming a contributor
related talks
54mHow Not to Write Slow Scala
39mExtreme Cleverness: Functional Data Structures in Scala
31mRadix Trees: How IntMap Works
23mThe Future of Scala Performance on Big Data
48mHigh performance Scala systems without tears
32mLIFTING DATA STRUCTURES TO THE TYPE-LEVEL
25mImmutable APIs and mutable internals: a Scala design case study
42mWhat Scala can learn from Rust, Swift, and C++
