~/talk

ArrayDeques and How to Contribute to Scala 2.13 Collections

Talkat Scala Days New York 2018 · 2018-06-19..06-21· [scala]
slides:none on file

Scala 2.13 adds a mutable ArrayDeque implemented as a circular array with start/end pointers that gives constant-time prepend/append/get and O(min(i, n-i)) insert/delete at index, using at most two memcpy copies on resize and a bit trick when capacity is power-of-two. Benchmarks (ref-tree visuals and GitHub code) show prepends that take milliseconds versus seconds for ArrayBuffer when growing to 10 million items. API includes both clear and clearAndShrink. Source, diagrams and benchmarks are on the linked repo.

AI-written summary · about

  1. 0:00Start
  2. 4:06New Collections
  3. 7:14Insert and Deletes
  4. 18:16Source Code
  5. 19:21Pre-Emptive Allocations of the Correct Size
  6. 20:42Benchmarks
  7. 22:54Takeaways
~/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.