~/talk

Immutable Sequential Maps – Keeping order while hashed

Talkat Scala Days Lausanne 2019 · 2019-06-11..06-13· [scala]
linkedin:oddmoller
slides:none on file

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

  1. 0:00Start
  2. 1:55What is a sequential map?
  3. 4:22Challenges
  4. 5:27Essential Operations
  5. 7:13LinkedHashMap
  6. 8:35Immutable
  7. 9:04Combination Strategy
  8. 10:18Definitions
  9. 16:03VectorMap - Removal
  10. 37:25Conclusions
  11. 39:54Becoming a contributor
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.